Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ interface UnhandledRejectionMessage {
interface ConsoleErrorMessage {
type: PreviewMessageType.ConsoleError;
args: any[];
stack: string;
}
```

Expand Down Expand Up @@ -350,6 +351,25 @@ Reload the provided iframe by sending a message to the iframe and falling back t

Returns a `Promise` that resolves when the reload has completed.

## `configureAPIKey`

Added in version `1.3.0`.

Configure an API key to be used for commercial usage of the WebContainer API. See https://webcontainers.io/enterprise for more information.

<h4 id="configureapikey-signature">
<a id="configureapikey-signature">Signature</a>
<a href="#configureapikey-signature" class="header-anchor" aria-hidden="true">#</a>
</h4>

<br />

<h4 id="configureapikey-signature">
<code>configureAPIKey(key: string): void</code>
</h4>

This function will throw an exception if `WebContainer.boot` was called before `configureAPIKey`.

## `auth`

The authentication API is exported under the `auth` namespace. It allows you to authenticate users visiting your website via StackBlitz. In order for users to be authenticated via this method, they must:
Expand Down Expand Up @@ -377,6 +397,9 @@ Intialize the authentication for use in WebContainer. This method should be call

<code>init(options: <a href="#authinit-options">AuthInitOptions</a>): { status: 'need-auth' | 'authorized' } | <a href="#authfailed-error">AuthFailedError</a></code>

This function will throw an exception if `WebContainer.boot` was called before `auth.init`.

<br />

<h4 id="authinit-options">
<a id="authinit-options"><code>AuthInitOptions</code></a>
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ head:

# Changelog

## 1.3.0

* Breaking change: we now throw if [`auth.init`](api#▸-init) is called after [`WebContainer.boot`](api#▸-boot)
* Add [`configureAPIKey`](api#configureapikey) to use the API with an API key.
* Add `stack` information to `console.error` messages coming from previews.

## 1.2.4

* Bug fix: [`reloadPreview`](api#reloadpreview) was always doing a hard refresh as the port was not transferred.
Expand Down