Görevler

Giriş yapma ve kimlik

Yanıtların kendisiyle ilgili olması ve aksiyonların onun adına çalışması için Rendel'e kimin giriş yaptığını bildirin ve token'ını iletin. Ardından, isteğe bağlı olarak neye baktığını da iletin.

Uygulamanızda giriş yapma özelliği varsa ve kurulum bundan önce çalıştıysa veya Rendel giriş yapılmış soruları sanki kimse yokmuş gibi yanıtlıyorsa.

Prompt

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; 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.

Projenizde açtığınız yapay zekâ kodlama aracınıza yapıştırın. Claude Code, Cursor, Codex, Windsurf, GitHub Copilot ve Gemini CLI üzerinde çalışır.

Asistanın yapacağı

  • Giriş yapıldıktan sonra ve geri yüklenen bir oturumda identify, çıkış yapıldığında ise reset çağırır.
  • Uygulamanızın kendi API'sine zaten gönderdiği, her sorudan önce istenen ve çıkış yapıldığında null olan token'ı Rendel'e iletir.
  • Giriş yapmanın kendisini ve token'ın diğer tüm kullanımlarını olduğu gibi bırakır.

Çalıştığını kontrol etme

Test sayfasında, Talk as altında bir kullanıcı seçin ve “son siparişim nerede?” diye sorun. O kullanıcı hakkında bir yanıt verilmesi, token'ın ulaştığı anlamına gelir. Uygulamanızda çıkış yapın ve tekrar sorun: sohbet temizlenir ve Rendel kimse yokmuş gibi yanıt verir.

Referans: ne yazdığı
Flutter
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, userHmac: user.rendelHmac); // after sign-in
Rendel.reset(); // on sign-out
Web
Rendel.setUserToken(() => auth.currentAccessToken()); // null when signed out
Rendel.identify({ userId: user.id, userHmac: user.rendelHmac });
Rendel.reset(); // on sign-out

Token, yalnızca istendiği tek çağrı için kullanılır ve atılır: asla saklanmaz, kaydedilmez, yönetim panelinde gösterilmez veya modelin önüne konmaz. Kendi uygulamanızda olduğu gibi, neye izin vereceğine API'niz karar verir. Bu üçünün (anahtar, identify, token) her birinin neden var olduğu: Giriş yapmış kullanıcı.

userHmac isteğe bağlıdır. Settings → Security → Request verification → Require a verified identity açıkken, backend'iniz kullanıcı kimliğini yönetim panelinin size verdiği gizli anahtarla küçük harfli hex HMAC_SHA256(userId, secret) olarak imzalar ve geçerli bir imzası olmayan kimlik, kimse yokmuş gibi değerlendirilir.

Neye baktıkları

Bir ürün sayfasında “bunu sepetime ekle” ifadesinin çalışabilmesi için Rendel'in ekrana ve küçük bir uygulama durumuna ihtiyacı vardır. Ekran için henüz bir setter yoktur; bunu bir context provider taşır.

Rendel asks which product or order the user means while it is on the screen.

Prompt

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.

Projenizde açtığınız yapay zekâ kodlama aracınıza yapıştırın. Claude Code, Cursor, Codex, Windsurf, GitHub Copilot ve Gemini CLI üzerinde çalışır.

Referans: ne yazdığı
Rendel.addContextProvider(
  'screen',
  () async => {'name': currentRoute, 'product_id': visibleProductId},
);

Provider'lar her mesajdan hemen önce çalışır. Rendel, döndürdüklerini veri olarak değerlendirir, asla talimat olarak değil.