Identify users
For flows to show up only once to a user, you need to identify the user. This is done by passing a userId
parameter to the init
function. This will allow you to count unique users that have seen your flows and show the flows only once to a specific user.
import { init } from "@flows/js";
init({
// Unique identifier for the user
// Prefer database ID over email if you're concerned about privacy of your users
userId: "xxxx"
projectId: "...",
})
The userId
parameter can be any unique identifier for the user. We recommend using a database ID or a UUID. We hash the user ID on the client side before sending it to our servers to protect your users' privacy.
Adding user properties
To target your flows to specific users, you can optionally pass user properties to the init
function. These properties can be used to target flows to specific users based on their properties.
import { init } from "@flows/js";
init({
userId: "xxxx",
projectId: "...",
userProperties: {
email: "john.doe@flows.sh"
name: "John Doe",
plan: "premium"
},
})
To protect your users' privacy Flows don’t store any personal data about your users. When you setup targeting based on user properties the evaluation is done on the client side. This means that the user data is never sent to our servers.
Reset user progress
You can reset which flows the user has already seen, either by calling a function from the SDK or by entering userId
manually in the Flows cloud.
Learn how to reset user progress →