@getnori/profile
A profile tab for Nori viewers: their name, admin status (or a request for admin access), loyalty points and the Nori SDK version.
The profile lives on your backend and follows the viewer's device credential,
so there is no separate sign-in. createDeviceProfileAccount reads and writes
it with that credential. The SDK supplies points and the version from the
client.
import { NoriProfile, createDeviceProfileAccount } from "@getnori/profile";
const account = createDeviceProfileAccount({
backendUrl: "https://adwise-backend.fastapicloud.dev",
credential: () => deviceCredential, // { device_id, device_secret, platform }
});
<NoriProfile client={noriClient} account={account} accentColor="#3578F4" />
Use ProfileAccount directly if your backend has its own profile API.
Exit to a home page
If your app is one of several behind a home page, pass exitHref="/" (or onExit for your own
navigation) to add an "All apps" button; exitLabel changes the text. Works on NoriProfile and
NoriProfileWeb.
Web
import { NoriProfileWeb, createDeviceProfileAccount, loadOrCreateDeviceCredential } from "@getnori/profile/web";
const credential = loadOrCreateDeviceCredential({
get: (k) => window.localStorage.getItem(k),
set: (k, v) => window.localStorage.setItem(k, v),
});
const account = createDeviceProfileAccount({ backendUrl, credential: () => credential });
<NoriProfileWeb client={noriClient} account={account} accentColor="#B3261E" />