File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,10 @@ final userToken = client.frontendToken('the-user-id');
6666#### Client API init
6767
6868``` dart
69- // Instantiate new client with a user token
70- var client = StreamFeedClient(apiKey, token: Token('userToken'));
69+ // Instantiate new client and set the user token
70+ var client = StreamFeedClient(apiKey);
71+
72+ await client.setUser(user:user, token: frontendToken);
7173```
7274
7375### 🔮 Examples
Original file line number Diff line number Diff line change @@ -45,9 +45,20 @@ import 'package:stream_feed_flutter_core/stream_feed_flutter_core.dart';
4545void main() {
4646 const apiKey = 'API-KEY';
4747 const userToken = 'USER-TOKEN';
48- final client = StreamFeedClient(
49- apiKey,
50- token: const Token(userToken),
48+ final client = StreamFeedClient(apiKey);
49+
50+ await client.setUser(
51+ const User(
52+ id: 'GroovinChip',
53+ data: {
54+ 'handle': '@GroovinChip',
55+ 'first_name': 'Reuben',
56+ 'last_name': 'Turner',
57+ 'full_name': 'Reuben Turner',
58+ 'profile_image': 'https://avatars.githubusercontent.com/u/4250470?v=4',
59+ },
60+ ),
61+ const Token(userToken),
5162 );
5263
5364 runApp(
You can’t perform that action at this time.
0 commit comments