API reference

Everything you need to know about Candu's API.

The Candu API surface is tiny. We want to maintain Candu to be as functional as possible, and to be very easy to understand and implement.

CanduProvider

import { CanduProvider } from "@candulabs/react-sdk"
​
<CanduProvider
clientToken="YOUR_CLIENT_TOKEN"
userId="USER_ID_TO_TRACK"
traits={USER_TRAITS_TO_TRACK}
styleguide={YOUR_STYLEGUIDE_OBJECT}
/>

CanduProvider creates a new instance of the client that bootstraps the application. After creating the new object, you will be able use the client to access different methods.

Arguments

Argument

Type

Required

Description

clientToken

String

Yes

The clientToken associated with your Candu application

userId

String

Yes

Unique identifier for the user in your database. A userId or an anonymousId is required.

traits

Object

No

End-user traits that you want track about that end-user. Traitsare used to match a Tutorial to a Segment in a Portal and for other dynamic behaviors

styleguide

Object

No

styleguide is a set of React components used to render content so that Candu looks native.

See the React Style Guide for details

You will not be able to create a Portal until you inject CanduPortal.

Portal

A portal is used to inject content into your application. Portals will use the styleguide you provide in order to render the Tutorials you created in the Candu dashboard.

import { Portal } from "@candulabs/react-sdk"
​
<Portal slug="YOUR_PORTAL_SLUG" />

Arguments

  1. slug (String): the unique identifier of your portal

​