StreamFeedClient constructor

StreamFeedClient(
  1. String apiKey, {
  2. String? secret,
  3. String? appId,
  4. StreamHttpClientOptions? options,
  5. Runner runner = Runner.client,
  6. StreamAPI? api,
  7. String fayeUrl = 'wss://faye-us-east.stream-io-api.com/faye',
  8. Level logLevel = Level.WARNING,
  9. LogHandlerFunction? logHandlerFunction,
})
  • Instantiate a new client (server side) with StreamFeedClient.connect using your api secret parameter and apiKey
var client = StreamFeedClient('YOUR_API_KEY',secret: 'API_KEY_SECRET');
  • Create a token for user with id "the-user-id"
var userToken = client.frontendToken('the-user-id');
  • if you are using the SDK client side, get a userToken in your dashboard and pass it to StreamFeedClient using the token parameter and apiKey
var client = StreamFeedClient('YOUR_API_KEY',token: Token('userToken'));

Implementation

factory StreamFeedClient(
  String apiKey, {
  String? secret,
  String? appId,
  StreamHttpClientOptions? options,
  Runner runner = Runner.client,
  StreamAPI? api,
  String fayeUrl = 'wss://faye-us-east.stream-io-api.com/faye',
  Level logLevel = Level.WARNING,
  LogHandlerFunction? logHandlerFunction,
}) =>
    StreamFeedClientImpl(
      apiKey,
      secret: secret,
      appId: appId,
      options: options,
      runner: runner,
      api: api,
      fayeUrl: fayeUrl,
      logLevel: logLevel,
      logHandlerFunction: logHandlerFunction,
    );