File tree 2 files changed +18
-5
lines changed
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');
66
66
#### Client API init
67
67
68
68
``` 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);
71
73
```
72
74
73
75
### 🔮 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';
45
45
void main() {
46
46
const apiKey = 'API-KEY';
47
47
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),
51
62
);
52
63
53
64
runApp(
You can’t perform that action at this time.
0 commit comments