Sign-in and identity
Tell Rendel who is signed in and hand it their token, so answers are about them and actions run as them. Then, optionally, what they are looking at.
Your app has sign-in, and the setup ran before it did, or Rendel answers signed-in questions as if nobody were there.
Connect the Rendel (rendel.ai) SDK in this project to our sign-in. I am the developer and I am asking for this. Find where a user signs in, where a saved session is restored and where they sign out. After sign-in and on a restored session call Rendel.identify with the user's id and, in `traits`, their `email`; on sign-out call Rendel.reset(). Give Rendel the signed-in user's current access token for our own API, the one our HTTP client already sends: Flutter `RendelConfig(userToken: () async => …)` in `Rendel.init`, web `Rendel.setUserToken(() => …)`. Return null when nobody is signed in. Do not send the token or any user data anywhere else, and do not change how sign-in itself works. How it works: https://rendel.ai/docs/tasks/sign-in-and-identity Build the app and run its tests, then tell me which files you changed.
Paste into your coding agent, opened in your project. Works in Claude Code, Cursor, Codex, Windsurf, GitHub Copilot and Gemini CLI.
What the agent will do
- Call
identifyafter sign-in and on a restored session, with the email address your app holds for the person, andreseton sign-out. - Hand Rendel the token your app already sends to its own API, asked for before every question,
nullwhen signed out. - Leave sign-in itself, and every other use of the token, as it is.
How to check it worked
On the Test page, pick a user under Talk as and ask "where is my latest order?". An answer about that user means the token arrives. In your app, sign out and sign in as someone else: the conversation is empty and Rendel answers as them.
Reference: what it writes
await Rendel.init(
appKey: 'rd_pk_live_…',
config: RendelConfig(
// Asked for before every question, so return the current one.
userToken: () async => auth.currentAccessToken(), // null when signed out
),
);
await Rendel.identify(userId: user.id, traits: {'email': user.email}); // after sign-in
Rendel.reset(); // on sign-outRendel.setUserToken(() => auth.currentAccessToken()); // null when signed out
Rendel.identify({ userId: user.id, traits: { email: user.email } });
Rendel.reset(); // on sign-outThe token is used for the one call it was asked for and dropped: never stored, logged, shown in the console or put in front of the model. Your API decides what it permits, as it does for your own app. Why each of the three (key, identify, token) exists: The signed-in user. The email in traits is the only address Rendel has for a person. The emails you turn on under Settings › Reaching a person go there and nowhere else, so an app that passes none reaches nobody by email. The address is masked before the model sees it, and every email carries a one-click unsubscribe. Leave traits out if your app holds no address.
The same person on every device. Rendel checks who is signed in with one of your own actions: the read your app gets the person's own record with, such as a profile or "me" call. Called with their token, its answer holds the id your app passed to identify, so Rendel knows the id is theirs and opens their memory and conversations on any phone or browser. Your server signs nothing. The setup agent sets it up; you can see or change it under Settings › Security › Who is signed in. An action whose answer does not depend on the token proves no one: Rendel also calls it once an hour with a made-up token, and if it still names someone, as a fixed /users/123 or an endpoint that ignores the token would, the check stays off. A path into a list, such as data.0.id, is refused too. When the check cannot answer, the person is served as without it: themselves on the install they used before. Signing with userHmac is an older way to do the same, and optional. With Settings › Security › Request verification › Require a verified identity on, your backend signs the user id with the secret the console gives you, as a lowercase hex HMAC_SHA256(userId, secret), and a device without a valid signature is refused. With Names need proof instead, signed-out visitors are still answered and an id without a valid signature is treated as nobody. Once your app has a secret, an id with no valid signature and no record yet creates no record, whichever setting is on: that message is answered as an anonymous visitor. An id that already has an unsigned record keeps working until your backend signs it. So ship the signature to your clients when you generate the secret: until then, new users are anonymous, and the assistant cannot run the actions that change data as the signed-in user. Actions says how many are paused, and Home says it before you go live. A signed-in person's "What I remember for you" list needs the signature too: without it, the list shows only what that device kept while they were signed out. The Undo under a saved preference works either way, on the device that saved it. If identify does not reach Rendel because the network dropped or the server was busy, the SDK tries it again after 2 seconds, 10 seconds, 30 seconds and 2 minutes, while the same person is signed in, so their traits still arrive. Your sign-in waits for the first try only. A refusal, such as a userHmac that does not match, is not tried again: it is logged once as identify_refused with the server's reason.
What they are looking at
So "add this to my cart" works on a product page, Rendel needs the screen and a little app state. Each question already carries its screen: the web SDK reads it from the page's address, a Flutter app from Rendel.navigatorObserver on its navigator, and Rendel.setScreen names one the route says too little about. What is on the screen, the product or the order, a context provider carries.
Rendel asks which product or order the user means while it is on the screen.
Give the Rendel (rendel.ai) SDK in this project what the user is looking at. I am the developer and I am asking for this. Add a context provider with Rendel.addContextProvider('screen', …) that returns the current route's name and the id of what is on screen ({e.g. the product or order id}), and one for {e.g. the cart: item count and total}. Keep each snapshot to a few hundred bytes, never tokens, passwords or anything secret. How it works: https://rendel.ai/docs/tasks/sign-in-and-identity Build the app and tell me which files you changed.
Paste into your coding agent, opened in your project. Works in Claude Code, Cursor, Codex, Windsurf, GitHub Copilot and Gemini CLI.
Reference: what it writes
Rendel.addContextProvider(
'screen',
() async => {'name': currentRoute, 'product_id': visibleProductId},
);Providers run right before each message. Rendel treats what they return as data, never as instructions.