|
1 | | -<!-- |
2 | | -This README describes the package. If you publish this package to pub.dev, |
3 | | -this README's contents appear on the landing page for your package. |
| 1 | +# StreamFeeds (Flutter) |
4 | 2 |
|
5 | | -For information about how to write a good package README, see the guide for |
6 | | -[writing package pages](https://dart.dev/tools/pub/writing-package-pages). |
| 3 | +This is the official Flutter SDK for StreamFeeds, a platform for building apps with activity feeds support. The repository includes a low-level SDK that communicates with Stream's backend, as well as a demo app that showcases how to use it. |
7 | 4 |
|
8 | | -For general information about developing packages, see the Dart guide for |
9 | | -[creating packages](https://dart.dev/guides/libraries/create-packages) |
10 | | -and the Flutter guide for |
11 | | -[developing packages and plugins](https://flutter.dev/to/develop-packages). |
12 | | ---> |
| 5 | +For detailed examples and supported features, please check out our [docs](https://getstream.io/activity-feeds/docs/flutter/). |
13 | 6 |
|
14 | | -TODO: Put a short description of the package here that helps potential users |
15 | | -know whether this package might be useful for them. |
| 7 | +Note: Activity Feeds V3 is in closed alpha — do not use it in production (just yet). |
16 | 8 |
|
17 | | -## Features |
| 9 | +## What is Stream? |
18 | 10 |
|
19 | | -TODO: List what your package can do. Maybe include images, gifs, or videos. |
| 11 | +Stream allows developers to rapidly deploy scalable feeds, chat messaging and video with an industry leading 99.999% uptime SLA guarantee. |
20 | 12 |
|
21 | | -## Getting started |
| 13 | +Stream lets you build **activity feeds at scale**. The largest apps on Stream have over **100 M+ users**. |
| 14 | +V3 keeps that scalability while giving you more flexibility over the content shown in your feed. |
22 | 15 |
|
23 | | -TODO: List prerequisites and provide or point to information on how to |
24 | | -start using the package. |
| 16 | +## What’s new in Feeds V3 |
25 | 17 |
|
26 | | -## Usage |
| 18 | +- **For-You feed**: Most modern apps combine a “For You” feed with a regular “Following” feed. V3 introduces **activity selectors** so you can: |
| 19 | + - surface popular activities |
| 20 | + - show activities near the user |
| 21 | + - match activities to a user’s interests |
| 22 | + - mix-and-match these selectors to build an engaging personalized feed. |
27 | 23 |
|
28 | | -TODO: Include short and useful examples for package users. Add longer examples |
29 | | -to `/example` folder. |
| 24 | +- **Performance**: 20–30 % faster flat feeds. Major speedups for aggregation & ranking (full benchmarks coming soon) |
| 25 | + |
| 26 | +- **Client-side SDKs** |
| 27 | + |
| 28 | +- **Activity filtering**: Filter activity feeds with almost no hit to performance |
| 29 | + |
| 30 | +- **Comments**: Voting, ranking, threading, images, URL previews, @mentions & notifications. Basically all the features of Reddit style commenting systems. |
| 31 | + |
| 32 | +- **Advanced feed features**: |
| 33 | + - Activity expiration |
| 34 | + - visibility controls |
| 35 | + - feed visibility levels |
| 36 | + - feed members |
| 37 | + - bookmarking |
| 38 | + - follow-approval flow |
| 39 | + - stories support. |
| 40 | + |
| 41 | +- **Search & queries**: Activity search, **query activities**, and **query feeds** endpoints. |
| 42 | + |
| 43 | +- **Modern essentials**: |
| 44 | + - Permissions |
| 45 | + - OpenAPI spec |
| 46 | + - GDPR endpoints |
| 47 | + - realtime WebSocket events |
| 48 | + - push notifications |
| 49 | + - “own capabilities” API. |
| 50 | + |
| 51 | +## 🚀 Getting Started |
| 52 | + |
| 53 | +### Installation |
| 54 | + |
| 55 | +The Flutter SDK for Stream Feeds is distributed through [pub.dev](https://pub.dev). |
| 56 | + |
| 57 | +Currently we only have a package for the low level Feeds client: [stream_feeds](https://pub.dev/packages/stream_feeds). |
| 58 | +Releases and changes are published on the [GitHub releases page](https://github.com/GetStream/stream-feeds-flutter/releases). |
| 59 | + |
| 60 | +### Adding the SDK to your project |
| 61 | + |
| 62 | +To add the Flutter SDK, you can add the latest dependencies for the SDK to your `pubspec.yaml` file: |
| 63 | + |
| 64 | +```yaml |
| 65 | +dependencies: |
| 66 | +stream_feeds: ^latest |
| 67 | +``` |
| 68 | +Additionally, you can also run the `flutter pub add` command in the terminal to do this: |
| 69 | + |
| 70 | +```shell |
| 71 | +flutter pub add stream_feed |
| 72 | +``` |
| 73 | + |
| 74 | +This command will automatically install the latest versions of the Stream SDK package from pub.dev to the dependencies section of your `pubspec.yaml`. |
| 75 | + |
| 76 | +### Basic Usage |
| 77 | + |
| 78 | +To get started, you need to create a `StreamFeedsClient` with your API key and a token. |
| 79 | + |
| 80 | +Afterwards, it's pretty straightforward to start adding feeds and activities. |
| 81 | + |
| 82 | +Check our docs for more details. |
30 | 83 |
|
31 | 84 | ```dart |
32 | | -const like = 'sample'; |
| 85 | +// Import the package |
| 86 | +import 'package:stream_feeds/stream_feeds.dart'; |
| 87 | +
|
| 88 | +// Initialize the client |
| 89 | +final client = StreamFeedsClient( |
| 90 | + apiKey: '<your_api_key>', |
| 91 | + user: User(id: 'john'), |
| 92 | + tokenProvider: TokenProvider.static(UserToken('<user_token>')), |
| 93 | +); |
| 94 | +
|
| 95 | +await client.connect(); |
| 96 | +
|
| 97 | +// Create a feed (or get its data if exists) |
| 98 | +final feed = client.feed(group: 'user', id: 'john'); |
| 99 | +final result = await feed.getOrCreate(); |
| 100 | +
|
| 101 | +// Add activity |
| 102 | +final activity = await feed.addActivity( |
| 103 | + request: FeedAddActivityRequest(type: 'post', text: 'Hello, Stream Feeds!'), |
| 104 | +); |
33 | 105 | ``` |
34 | 106 |
|
35 | | -## Additional information |
| 107 | +## 📖 Key Concepts |
| 108 | + |
| 109 | +### Activities |
| 110 | + |
| 111 | +Activities are the core content units in Stream Feeds. They can represent posts, photos, videos, polls, and any custom content type you define. |
| 112 | + |
| 113 | +### Feeds |
| 114 | + |
| 115 | +Feeds are collections of activities. They can be personal feeds, timeline feeds, notification feeds, or custom feeds for your specific use case. |
| 116 | + |
| 117 | +### Real-time Updates |
| 118 | + |
| 119 | +Stream Feeds provides real-time updates through WebSocket connections, ensuring your app stays synchronized with the latest content. |
| 120 | + |
| 121 | +### Social Features |
| 122 | + |
| 123 | +Built-in support for reactions, comments, bookmarks, and polls makes it easy to build engaging social experiences. |
| 124 | + |
| 125 | +## 👩💻 Free for Makers 👨💻 |
36 | 126 |
|
37 | | -TODO: Tell users more about the package: where to find more information, how to |
38 | | -contribute to the package, how to file issues, what response they can expect |
39 | | -from the package authors, and more. |
| 127 | +Stream is free for most side and hobby projects. To qualify, your project/company needs to have < 5 team members and < $10k in monthly revenue. Makers get $100 in monthly credit for video for free. |
0 commit comments