Navigation

Handle events & actions

Once Rupt is integrated into your website, it maps a user journey to a set of events. These events are emitted by the SDK and can be listened to by your application. Here is a list of events and user actions that can be listened to:

EventInitiatorHandler typeDescription
on_limit_exceededSDKfunctionCalled when the user exceeds the device limit.
on_challengeSDKfunctionCalled when Rupt determines that the user should be challenged (more about challenges here).
redirect_urls.new_account_urlUserurl string(required) A URL to redirect the user to if they want to stop account sharing and create a new account.
redirect_urls.logout_urlUserurl string(required) A URL to redirect the user to if they choose to logout or if they are kicked out by a verified owner.
redirect_urls.success_urlSDKurl string(optional) A URL to redirect the user to if they are successfully verified and are within the device limit.
redirect_urls.suspended_urlSDKurl string(optional) A URL to redirect the user to if they are suspended.
redirect_urls.upgrade_urlSDKurl string(optional) A URL to redirect the user to if they choose to upgrade and skip a free trial (when challenged for multiple trials)
await Rupt.attach({
  client_id: `your_api_client_id`,
  account: `user_account_id`,
  on_challenge: () => {
    /* optional */
  },
  on_limit_exceeded: ({ attached_devices }) => {
    /* optional */
  },
  redirect_urls: {
    new_account_url: `https://yourwebsite.com/new-account`, // required
    logout_url: `https://yourwebsite.com/logout`, // required
    success_url: `https://yourwebsite.com/success`, // optional
    suspended_url: `https://yourwebsite.com/suspended`, // optional
    upgrade_url: `https://yourwebsite.com/upgrade`, // optional
  },
});

on_limit_exceeded

This is called when the user exceeds the device limit. This is an informational callback and does not affect the user journey. You can use this callback to do any internal work or for custom conversion journeys.

on_challenge

This is called when Rupt determines that the user should be challenged. This can happen if the account has too many people or too many devices attached to it. You can use this callback to do any internal work before the user is redirect to the challenge page. If this function returns false, the user will not be redirected to the challenge page.

redirect_urls

These are the URLs that Rupt will redirect the user to when certain events happen. Some URLs are required for a complete experience. Others are optional and can be used to customize the user journey.

redirect_urls.new_account_url

This is the URL that Rupt will redirect the user to if they want to stop account sharing and create a new account. This URL is required.

redirect_urls.logout_url

This is the URL that Rupt will redirect the user to if they choose to logout or if they are kicked out by a verified owner. This URL is required.

redirect_urls.success_url

This is the URL that Rupt will redirect the user to if they are successfully verified and are within the device limit. This URL is optional. If this URL is not provided, Rupt will redirect the user to the url they were on before they were redirected to the Rupt challenge page.

redirect_urls.suspended_url

This is the URL that Rupt will redirect the user to if they are suspended. This URL is optional. If this URL is not provided, Rupt will redirect the user to the a hosted & branded suspended page. You can learn more about suspended pages here.

redirect_urls.upgrade_url

A URL to redirect the user to if they choose to upgrade. This URL is optional. If this URL is not provided, Rupt will not show an account upgrade redirect button on the Rupt challenge page.