Skip to main content

Installing Candu

Install Candu within your application in 2-3 quick and easy steps!

Flora Sanders avatar
Written by Flora Sanders
Updated over 2 weeks ago

Step 1: Add Candu Script Tags

To get started adding Candu content to your application, you will need to add the Candu script tag into the <head> of your site to give Candu permission to embed content.

To find your Candu Script, go into the Candu Dashboard Settings > Installation tab from the top bar menu. Copy the top code block as seen below:

An example of where you can find Candu's API Key and Client token.

It will look something like this:

Each installation script will have a unique Client Token. The Client Token is used to access Content via the Candu SDK and can also be found in the Workspaces tab under Access Keys.

If you intend to send Candu user data via an integration like Segment.com, you must also pass us UserIDs via the install script. We need a unique identifier to map and identify Users between your application and the third-party integration. It is most common to use an ID, which is usually a number like '7480', but if you do not assign IDs like this, you can alternatively use email addresses as the unique identifier.

For detailed information about the initialization options and parameters available with Candu.init, refer to our developer documentation.


Step 2: Whitelist Your Domains

Before any content can be added or published, you must whitelist all domains where you want Candu content to appear.

  • Add your domain to the list under 'Whitelisted Domains'

  • Please note that you can use wildcards here as needed. Add a * before or after the URL to add a wildcard. For example, if you want to use Candu on many different pages within your product or across multiple domains, you can simply put a * as a domain. If you encounter CORS errors when publishing content, it likely concerns whitelisting. To check, try whitelisting just the wildcard and clear the cache.

If you encounter CORS errors when publishing content, it likely concerns whitelisting. To check, try whitelisting just the wildcard and clear the cache.

Once you've added the script tag to the head of your site and whitelisted your domains, you can start creating Candu content and use the Candu Chrome Extension to embed content to any existing <div> on the page.

Guides on Previewing, Publishing & Embedding Content.

Step 3: Content Security Policy (CSP) Whitelisting

Depending on your product's Content Security Policy (CSP), you may also need to whitelist the following URLs in your CSP configuration:

  • https://api.candu.ai/

  • https://cdn.candu.ai/

  • https://media.candulabs.com/

This ensures that your application can properly load Candu's resources and function correctly.

Once you've added the script tag to the head of your site and whitelisted your domains, you can start creating Candu content and use the Candu Chrome Extension to embed content to any existing <div> on the page.


Step 4: Send Candu Data for Segmentation/Variables (Optional)

Suppose you want to personalize your Candu content using Segmentation and Variables. In that case, you must send us data directly via the install script, Webhooks, or connect to a third-party data source like Segment.com.

We recommend setting up Signed Identities to ensure your user data is as secure as possible. Only workspace Owners and Admins can turn Signed Identities on/off.

Check our Troubleshooting guide for potential resolutions. You can always contact us at [email protected]

Frequently Asked Questions

Q: Does Candu work with Single Page Applications (SPAs)?

A: Yes! Candu works with SPAs out of the box with no additional setup required. Our SDK automatically monitors URL and DOM changes, so your Candu content will appear correctly as users navigate within your application without requiring page refreshes.

If you experience any issues, ensure your Candu script is properly installed in the header, your domains are whitelisted, and CSP settings include Candu's required URLs.

Did this answer your question?