diff --git a/README.md b/README.md index 8eb1d4456..04bb94043 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Preview Coral easily by running Coral via a Heroku App: - [Source](#source) - [Embed On Your Site](#embed-on-your-site) - [Single Sign On](#single-sign-on) + - [SSO Login Prompts](#sso-login-prompts) - [Development](#development) - [Email](#email) - [Design Language System (UI Components)](#design-language-system-ui-components) @@ -245,6 +246,23 @@ embed.login("{{ SSO_TOKEN }}"); embed.logout(); ``` +#### SSO Login Prompts + +In order to handle login prompts (e.g. a user clicks on the sign in button) you can listen to the `loginPrompt` event. + +```js +var embed = Coral.createStreamEmbed({ + // Don't forget to include the parameters from the + // "Embed On Your Site" section. + events: function(events) { + events.on("loginPrompt", function() { + // Redirect user to a login page. + location.href = "http://example.com/login"; + }); + }, +}); +``` + ### Development Running Coral for development is very similar to installing Coral via Source as diff --git a/src/core/client/embed/index.html b/src/core/client/embed/index.html index 019d1b710..3bd2327e9 100644 --- a/src/core/client/embed/index.html +++ b/src/core/client/embed/index.html @@ -23,6 +23,17 @@