Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: feature flag offline mode

lawvs07cf74d52f16
diff --git a/libs/datasource/feature-flags/README.md b/libs/datasource/feature-flags/README.md
index f5c59f4e13..7a04209c5d 100644
--- a/libs/datasource/feature-flags/README.md
+++ b/libs/datasource/feature-flags/README.md
@@ -2,7 +2,15 @@
## Usage
-- set provider
+- Set token at environment variable
+ - The key can be obtained from the [Feature Flag Portal](https://portal.featureflag.co/account-settings/projects)
+
+```shell
+# .env.local
+AFFINE_FEATURE_FLAG_TOKEN=XXXXXXX
+```
+
+- Set provider
```tsx
import { FeatureFlagsProvider } from '@toeverything/datasource/feature-flags';
@@ -42,7 +50,8 @@ const App = () => {
**When entering development mode feature flag will NOT be updated in real time**
-- `activateFfcDevMode()` play with feature flags locally
+- `activateFfcDevMode(PASSWORD)` play with feature flags locally
+ - The `devModePassword` can be obtained from `src/config.ts`
- `quitFfcDevMode()` quit dev mode
## Running unit tests
diff --git a/libs/datasource/feature-flags/src/config.ts b/libs/datasource/feature-flags/src/config.ts
index 7f3360d6db..b89a2e7359 100644
--- a/libs/datasource/feature-flags/src/config.ts
+++ b/libs/datasource/feature-flags/src/config.ts
@@ -8,4 +8,5 @@ export const config: IOption = {
// id: 'the user's unique identifier'
// }
devModePassword: '-',
+ enableDataSync: !!process.env['AFFINE_FEATURE_FLAG_TOKEN'],
};