Portal
SandboxAPI v1Not signed inExternal user: —

Multi-user

Problem: Isolate pantry per tenant user. PythonTypeScript for user_id in ("alice", "bob"): scoped = FoodAPI(api_key="...", external_user_id=user_id)…

Problem: Isolate pantry per tenant user.

for user_id in ("alice", "bob"):
    scoped = FoodAPI(api_key="...", external_user_id=user_id)
    print(user_id, len(scoped.pantry.list().items))
    scoped.close()
for (const userId of ["alice", "bob"]) {
  const scoped = new FoodAPI({ apiKey: "...", externalUserId: userId });
  const pantry = await scoped.pantry.list();
  console.log(userId, pantry.items.length);
}

See External user context for partitioning rules and header details.