Skip to content

Commit c4adc2a

Browse files
authored
chore: provide random id when generating feeds credentials (#2037)
### 💡 Overview ### 📝 Implementation notes 🎫 Ticket: https://linear.app/stream/issue/REACT-697/create-feeds-credentials-for-tutorial 📑 Docs: https://github.com/GetStream/docs-content/pull/<id>
1 parent f5c764a commit c4adc2a

File tree

1 file changed

+3
-1
lines changed
  • sample-apps/react/react-dogfood/pages/api/call

1 file changed

+3
-1
lines changed

sample-apps/react/react-dogfood/pages/api/call/sample.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ async function createSampleAppCall(req: NextApiRequest, res: NextApiResponse) {
4646
const appConfig = getEnvironmentConfig(data.app_type);
4747

4848
const userName = getRandomName();
49-
const userId = toUserId(userName);
49+
// Feeds tutorial needs unique user ids (we use user id as feed id)
50+
const userId =
51+
data.app_type === 'feedsv3' ? crypto.randomUUID() : toUserId(userName);
5052
const token = await createToken(userId, appConfig.apiKey, appConfig.secret);
5153
const buddyUserName = getBuddyUserName(userName);
5254
const buddyUserId = toUserId(buddyUserName);

0 commit comments

Comments
 (0)