Skip to content

Commit 471b7e7

Browse files
committed
chore: update docs
1 parent 847790c commit 471b7e7

16 files changed

Lines changed: 63 additions & 36 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ from replane import Replane
3636
# Using context manager (recommended)
3737
with Replane(
3838
base_url="https://replane.example.com",
39-
sdk_key="sk_live_...",
39+
sdk_key="rp_...",
4040
) as client:
4141
# Get a simple config value
4242
rate_limit = client.get("rate-limit")
@@ -60,7 +60,7 @@ from replane import AsyncReplane
6060

6161
async with AsyncReplane(
6262
base_url="https://replane.example.com",
63-
sdk_key="sk_live_...",
63+
sdk_key="rp_...",
6464
) as client:
6565
# get() is sync since it reads from local cache
6666
rate_limit = client.get("rate-limit")
@@ -76,7 +76,7 @@ Both clients accept the same configuration:
7676
```python
7777
client = Replane(
7878
base_url="https://replane.example.com",
79-
sdk_key="sk_live_...",
79+
sdk_key="rp_...",
8080

8181
# Default context applied to all get() calls
8282
context={"environment": "production"},
@@ -118,19 +118,22 @@ value = client.get("feature-flag", context=context)
118118
### Override Examples
119119

120120
**Percentage rollout** (gradual feature release):
121+
121122
```python
122123
# Server config has 10% rollout based on user_id
123124
# Same user always gets same result (deterministic hashing)
124125
enabled = client.get("new-checkout", context={"user_id": user.id})
125126
```
126127

127128
**Plan-based features**:
129+
128130
```python
129131
max_items = client.get("max-items", context={"plan": user.plan})
130132
# Returns different values for free/pro/enterprise plans
131133
```
132134

133135
**Geographic targeting**:
136+
134137
```python
135138
content = client.get("homepage-banner", context={"country": request.country})
136139
```
@@ -279,7 +282,7 @@ async def lifespan(app: FastAPI):
279282
global client
280283
client = AsyncReplane(
281284
base_url="https://replane.example.com",
282-
sdk_key="sk_live_...",
285+
sdk_key="rp_...",
283286
)
284287
await client.connect()
285288
yield
@@ -311,7 +314,7 @@ def init_replane():
311314
global replane_client
312315
replane_client = Replane(
313316
base_url="https://replane.example.com",
314-
sdk_key="sk_live_...",
317+
sdk_key="rp_...",
315318
)
316319
replane_client.connect()
317320

examples/basic-async/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pip install -r requirements.txt
2727

2828
```python
2929
BASE_URL = "https://your-replane-server.com"
30-
SDK_KEY = "sk_your_sdk_key_here"
30+
SDK_KEY = "your_sdk_key_here"
3131
```
3232

3333
## Run

examples/basic-async/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Configuration - replace with your actual values
1212
BASE_URL = "https://your-replane-server.com"
13-
SDK_KEY = "sk_your_sdk_key_here"
13+
SDK_KEY = "your_sdk_key_here"
1414

1515

1616
async def main():

examples/basic-sync/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pip install -r requirements.txt
2727

2828
```python
2929
BASE_URL = "https://your-replane-server.com"
30-
SDK_KEY = "sk_your_sdk_key_here"
30+
SDK_KEY = "your_sdk_key_here"
3131
```
3232

3333
## Run

examples/basic-sync/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Configuration - replace with your actual values
1010
BASE_URL = "https://your-replane-server.com"
11-
SDK_KEY = "sk_your_sdk_key_here"
11+
SDK_KEY = "your_sdk_key_here"
1212

1313

1414
def main():

examples/django-integration/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pip install -r requirements.txt
2727

2828
```bash
2929
export REPLANE_BASE_URL="https://your-replane-server.com"
30-
export REPLANE_SDK_KEY="sk_your_sdk_key_here"
30+
export REPLANE_SDK_KEY="your_sdk_key_here"
3131
```
3232

3333
Or update the defaults in `config/settings.py`.
@@ -62,13 +62,15 @@ django-integration/
6262
## API Endpoints
6363

6464
### `GET /`
65+
6566
Homepage that shows different content based on the `new-dashboard-enabled` feature flag.
6667

6768
```bash
6869
curl http://localhost:8000/
6970
```
7071

7172
### `GET /api/items/`
73+
7274
List items with rate limiting info based on user's plan.
7375

7476
```bash
@@ -80,13 +82,15 @@ curl -H "X-User-Plan: premium" http://localhost:8000/api/items/
8082
```
8183

8284
### `POST /api/upload/`
85+
8386
Upload endpoint with configurable max file size based on user's plan.
8487

8588
```bash
8689
curl -X POST http://localhost:8000/api/upload/
8790
```
8891

8992
### `GET /api/config/`
93+
9094
Debug endpoint showing current configuration values.
9195

9296
```bash
@@ -95,6 +99,7 @@ curl -H "X-User-ID: user-123" -H "X-User-Plan: premium" \
9599
```
96100

97101
### `GET /health/`
102+
98103
Health check endpoint showing Replane connection status.
99104

100105
```bash

examples/django-integration/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# =============================================================================
5858

5959
REPLANE_BASE_URL = os.environ.get("REPLANE_BASE_URL", "https://your-replane-server.com")
60-
REPLANE_SDK_KEY = os.environ.get("REPLANE_SDK_KEY", "sk_your_sdk_key_here")
60+
REPLANE_SDK_KEY = os.environ.get("REPLANE_SDK_KEY", "your_sdk_key_here")
6161

6262
# Fallback values if Replane server is unavailable
6363
REPLANE_FALLBACKS = {

examples/fastapi-integration/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pip install -r requirements.txt
2727

2828
```bash
2929
export REPLANE_BASE_URL="https://your-replane-server.com"
30-
export REPLANE_SDK_KEY="sk_your_sdk_key_here"
30+
export REPLANE_SDK_KEY="your_sdk_key_here"
3131
```
3232

3333
Or update the defaults in `app.py`.
@@ -49,13 +49,15 @@ The server will start on `http://localhost:8000`.
4949
## API Endpoints
5050

5151
### `GET /`
52+
5253
Homepage that shows different content based on the `new-dashboard-enabled` feature flag.
5354

5455
```bash
5556
curl http://localhost:8000/
5657
```
5758

5859
### `GET /api/items`
60+
5961
List items with rate limiting info based on user's plan.
6062

6163
```bash
@@ -67,13 +69,15 @@ curl -H "X-User-Plan: premium" http://localhost:8000/api/items
6769
```
6870

6971
### `POST /api/upload`
72+
7073
Upload endpoint with configurable max file size based on user's plan.
7174

7275
```bash
7376
curl -X POST http://localhost:8000/api/upload
7477
```
7578

7679
### `GET /api/config`
80+
7781
Debug endpoint showing current configuration values.
7882

7983
```bash
@@ -82,6 +86,7 @@ curl -H "X-User-ID: user-123" -H "X-User-Plan: premium" \
8286
```
8387

8488
### `GET /health`
89+
8590
Health check endpoint showing Replane connection status.
8691

8792
```bash

examples/fastapi-integration/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Configuration from environment variables
1717
BASE_URL = os.environ.get("REPLANE_BASE_URL", "https://your-replane-server.com")
18-
SDK_KEY = os.environ.get("REPLANE_SDK_KEY", "sk_your_sdk_key_here")
18+
SDK_KEY = os.environ.get("REPLANE_SDK_KEY", "your_sdk_key_here")
1919

2020
# Global client instance
2121
replane_client: AsyncReplane | None = None

examples/feature-flags/README.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pip install -r requirements.txt
2727

2828
```python
2929
BASE_URL = "https://your-replane-server.com"
30-
SDK_KEY = "sk_your_sdk_key_here"
30+
SDK_KEY = "your_sdk_key_here"
3131
```
3232

3333
## Run
@@ -150,17 +150,23 @@ For these examples to work fully, configure the following in your Replane dashbo
150150
"overrides": [
151151
{
152152
"name": "starter-plan",
153-
"conditions": [{"operator": "equals", "property": "plan", "expected": "starter"}],
153+
"conditions": [
154+
{ "operator": "equals", "property": "plan", "expected": "starter" }
155+
],
154156
"value": 500
155157
},
156158
{
157159
"name": "pro-plan",
158-
"conditions": [{"operator": "equals", "property": "plan", "expected": "pro"}],
160+
"conditions": [
161+
{ "operator": "equals", "property": "plan", "expected": "pro" }
162+
],
159163
"value": 2000
160164
},
161165
{
162166
"name": "enterprise-plan",
163-
"conditions": [{"operator": "equals", "property": "plan", "expected": "enterprise"}],
167+
"conditions": [
168+
{ "operator": "equals", "property": "plan", "expected": "enterprise" }
169+
],
164170
"value": 10000
165171
}
166172
]
@@ -176,11 +182,13 @@ For these examples to work fully, configure the following in your Replane dashbo
176182
"overrides": [
177183
{
178184
"name": "beta-users",
179-
"conditions": [{
180-
"operator": "in",
181-
"property": "user_id",
182-
"expected": ["user-1", "user-2", "user-3"]
183-
}],
185+
"conditions": [
186+
{
187+
"operator": "in",
188+
"property": "user_id",
189+
"expected": ["user-1", "user-2", "user-3"]
190+
}
191+
],
184192
"value": true
185193
}
186194
]
@@ -196,13 +204,15 @@ For these examples to work fully, configure the following in your Replane dashbo
196204
"overrides": [
197205
{
198206
"name": "10-percent-rollout",
199-
"conditions": [{
200-
"operator": "segmentation",
201-
"property": "user_id",
202-
"fromPercentage": 0,
203-
"toPercentage": 10,
204-
"seed": "experimental-feature-rollout"
205-
}],
207+
"conditions": [
208+
{
209+
"operator": "segmentation",
210+
"property": "user_id",
211+
"fromPercentage": 0,
212+
"toPercentage": 10,
213+
"seed": "experimental-feature-rollout"
214+
}
215+
],
206216
"value": true
207217
}
208218
]

0 commit comments

Comments
 (0)