How to use the getstream.connectCloud function in getstream

To help you get started, we’ve selected a few getstream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GetStream / react-native-activity-feed / example / scripts / test_notification.js View on Github external
console.error('STREAM_API_KEY should be set');
    return;
  }

  if (!appId) {
    console.error('STREAM_APP_ID should be set');
    return;
  }

  if (!apiSecret) {
    console.error('STREAM_SECRET should be set');
    return;
  }

  console.log(apiKey, apiSecret);
  let client: CloudClient = stream.connectCloud(apiKey, appId, {
    // urlOverride: {
    //   api: apiUrl,
    // },
    keepAlive: false,
  });

  function createUserSession(userId): UserSession {
    return client.createUserSession(
      stream.signing.JWTUserSessionToken(apiSecret, userId),
    );
  }

  let batman = createUserSession('batman');
  let content = 'test2';
  console.log(await batman.feed('notification').get({ limit: 1 }));
  await batman.feed('notification').addActivity({
github GetStream / react-native-activity-feed / example / scripts / initData.js View on Github external
if (!apiKey) {
    console.error('STREAM_API_KEY should be set');
    return;
  }

  if (!appId) {
    console.error('STREAM_APP_ID should be set');
    return;
  }

  if (!apiSecret) {
    console.error('STREAM_SECRET should be set');
    return;
  }

  let client: CloudClient = stream.connectCloud(apiKey, appId);

  function createUserSession(userId): UserSession {
    return client.createUserSession(
      stream.signing.JWTUserSessionToken(apiSecret, userId),
    );
  }

  let batman = createUserSession('batman');
  let fluff = createUserSession('fluff');
  let league = createUserSession('justiceleague');
  let bowie = createUserSession('davidbowie');

  console.log('Add the following line to your .env file');
  console.log('STREAM_API_TOKEN=' + batman.token);

  await batman.user.getOrCreate({

getstream

The official low-level GetStream.io client for Node.js and the browser.

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

84 / 100
Full package analysis