Skip to main content

Initialization

Get started by initializing the Nudge SDK in your web application.

API Key

You will need to contact support@getnudgeai.com to get your API key and secret.

Include the SDK in your HTML

Add the following code snippet in the <head> element of your application:

<script src="https://app.getnudgeai.com/js/<YOUR_API_KEY>/nudgeai.js"></script>

Initialization

Initialize the API with your secret.

const nudgeai = NudgeAI('<YOUR_API_SECRET>', options);

Embedding capture module

The capture modal can be place anywhere in your site. When initializing make sure to pass the id of the element where you want it embedded and the client id.

  const recorder = nudgeai.embed_capture(
element_id="capture_session_id",
client_id="042491a0-5341-4420-a2f8-74c7e893ac1c"
)

You'll need to make sure to have an element somewhere on the page with this id.

<body>
...
<div id="capture_session_id"></div>
...
</body>