Step 2: Embed your FileFeed Builder

Generate a Code Snippet

  • On OneSchema's admin dashboard, navigate to theEmbedding FileFeeds section on the FileFeeds tab.
  • You can choose an existingFileFeed as long as the template attached the the FileFeedhas been pushed to the chosen environment. An environment controls which version of a template is used and which environment variables are passed to webhooks.
  • Embeddable FileFeeds currently supports Javascript, React, Angular, Vue SDKs
  • If relevant, install the appropriate package using npm or yarn

Authentication

  • For authenticating your users, you will need to generate a OneSchema JWT token that is signed by a OneSchema client_secret.
  • The Admin dashboard will give you a signed OneSchema JWT in your code snippet, but in production, you will have to generate these on your backend.

Receiving events

  • For receiving events from your FileFeed runs when files have errors or files are successful, you will need to create an event webhook and attach the event_webhook_key.

Launch the code snippet

  • Paste the code snippet into your application and click the "Launch" button to launch the OneSchema Embedded FileFeed Builder.

Resuming sessions

  • Each FileFeed Embedded builder corresponds to a session. The code snippet page behavior instantiates a new session. By using the session token associated with an existing session token, we can re-join an existing session.
  • There are two ways to retrieve a session token.
    • When creating a session via our external api, the session token is exposed on the success payload.
    • When we create a session via the sdk the session token, is returned on the init-succeeded payload.
  • A session token can be passed as an initialization param in the sdk. It can be passed either at init as a FileFeedParam or at launch as a FileFeedLaunchParam When a session token is provided, the session token is validated against the provided jwt. A session token overrides all other FileFeed params as it restores the state of the existing session.
  • There is auto-resume behavior built into the FileFeed embedding, meaning that session_token is automatically saved and the SDK will resume the session if it was not closed through normal means (e.g., browser closing or refreshing). However, the session will not resume if the user Cancels it or if they hit the Save button, or if for any other reason the session goes invalid (such as changes to the FileFeed from the dashboard or other embed sessions).