Creating a Visitor
// ...import code
Flagship.start("<ENV_ID>", "<API_KEY>");
const fsVisitor = Flagship.newVisitor({
visitorId: "<VISITOR_ID>",
hasConsented: true,
context: {
isVIP: true,
country: "NL",
loginProvider: "Google"
}
});import React from "react";
import { FlagshipProvider } from "@flagship.io/react-sdk";
const App = () => (
<>
<FlagshipProvider
envId="<ENV_ID>"
apiKey="<API_KEY>"
visitorData={{
id: "<VISITOR_ID>",
hasConsented: true, // This is required
context: {
isVIP: true,
country: "NL",
loginProvider: "Google"
}
}}
>
{/* ... */}
</FlagshipProvider>
</>
);SDK
Last updated
Was this helpful?

