Install Client SDK

The Client SDK is the code that runs in your application if you want to recruit in-app.

To start, please choose one of the following installation options. They are functionally equivalent, so just choose the one easiest to implement for your application.

Option 1: Tracking Snippet

This is our tracking snippet. Please place it into the <head> of your website, before you load your own JavaScript (to ensure that the API is visible to your JavaScript).

Note the {{space-id}} placeholder in the last line (you can find yours at in the Admin)

Tracking Snippet

<script>
(function(o,r,b,i,t,a,l){
o[r]||(t=o[r]=function(){i.push(arguments)},t._t=new Date,t._v=1,i=t._q=[])
})(window,'orbital');
// orbital('identify', {{user-id}}, {email: {{email}}}); // This line only needed if recruiting from a specific segment
</script>
<!-- Note the space-id in the URL below. -->
<script src="https://client.useorbital.com/api/account/{{space-id}}/client.js" async></script>

Option 2: UMD Module

To start adding the orbital sdk to your project install its package via your favorite package manager.

Installing the orbital sdk package

npm install @useorbital/client-sdk

Then initialize it and start recruiting. Below are snippets for TypeScript, React, or React with SSR:

Integrating the orbital sdk

import orbital from '@useorbital/client-sdk'

const orbitalSdk = await orbital('your-space-id')

Option 3: Google Tag Manager (GTM)

If you already have GTM in place, just place the tracking snippet above into a new “Custom HTML” Tag triggered on “Initialization - All Pages”. Your unique {{space-id}} can be hardcoded in the tag, but the variables passed to the identify call need to be setup as GTM variables (eg. “Data Layer Variable”) as they are unique per user.

Adapt your Content Security Policy

In addition to one of the installation options above, you'll need to extend your Content Security Policy (CSP) to allow useorbital.com like so:

script-src *.useorbital.com;
connect-src *.useorbital.com;
frame-src *.useorbital.com;

Next Steps

Now that the client is installed, learn about the configuration options or get started with your first discovery.

Was this page helpful?