Full API documentation for the Nudgify JavaScript snippet.
Paste the snippet before the closing </body> tag in your app's HTML. Your developer does this once — after that, you manage everything from the dashboard.
<!-- Add before closing </body> tag -->
<script src="https://nudgify.app/snippet" async></script>
<script>
Nudgify.init("proj_xxxxxxxxxxxx");
</script>Replace proj_xxxxxxxxxxxx with your project key from the Settings page.
Nudgify.init(projectKey, options?)Initializes the snippet. Call once on page load, before identify(). After this, Nudgify evaluates targeting rules and shows matching flows.
projectKeystringrequiredYour project API key from the Settings page.
options.hideWatermarkbooleanHides the 'Powered by Nudgify' badge. Available on paid plans.
Nudgify.identify(user)Optional. Pass user properties to enable plan-based and session-based targeting. Call after your user logs in. It's safe to call init() before identify() — Nudgify re-evaluates rules when identify() is called.
Nudgify.identify({
id: "user_123", // your user's unique ID
plan: "free", // "free" | "pro"
session_count: 3, // how many times they've logged in
role: "admin", // optional
});idstringYour user's unique ID from your database.
planstring"free" | "pro" — used in upgrade-prompt targeting.
session_countnumberHow many sessions this user has had. Target first-timers or power users.
rolestringOptional role string — e.g. "admin" | "viewer".
Nudgify.reset()Clears all shown-flow state in localStorage. Useful for testing — lets you see flows again without creating a new user.
Nudgify.reset();
Nudgify tracks these events automatically and sends them to your analytics dashboard. Events are batched and sent every 5 seconds, or immediately on page unload.
flow_shownThe flow was displayed to the user.
step_advancedUser clicked the CTA button to advance to the next step.
flow_completedUser finished the last step (or clicked a Complete action).
flow_dismissedUser closed the flow early via the ✕ button.