githubEdit

Get started with Vue

Use Seam Components with Vue

Overview

This guide will show you how to use Seam Components inside a Vue application. Seam Components are implemented in React, but may be used anywhere as native web components.

1 - Get a Publishable Key from the Seam Console

To access the Seam API, you'll need a publishable key. This key identifies your application when making requests to Seam and is safe to embed in your frontend code.

Go to console.seam.coarrow-up-right and select "Client Sessions" from the sidebar. You should then see a "Publishable Key" that you can copy.

Publishable key

2 - Install @seamapi/react in your Vue application

Install the npm package

Then import the custom elements bundle in you main.js application entrypoint:

3 β€” Skip Component Resolution

From the Vue Docsarrow-up-right:

By default, Vue will attempt to resolve a non-native HTML tag as a registered Vue component before falling back to rendering it as a custom element. This will cause Vue to emit a "failed to resolve component" warning during development. To let Vue know that certain elements should be treated as custom elements and skip component resolution, we can specify the compilerOptions.isCustomElement option.

4 - Use the component

Use the components in App.vue:

You should see a list of device models like what's shown below:

Supported devices

Next Steps

If you have any questions or want to report an issue, email us at [email protected].

Last updated

Was this helpful?