1- # @ripstop/web
1+ <p align =" center " >
2+ <a href =" https://ripstop.dev " ><img src =" https://ripstop.dev/mark.png " width =" 56 " alt =" Ripstop " ></a >
3+ </p >
24
3- ** Remote config, update walls and maintenance mode for web apps.**
4- Signed at the edge, verified in the browser, 6.5 KB gzipped.
5+ <h1 align =" center " >Ripstop Web SDK</h1 >
56
6- [ ![ npm] ( https://img.shields.io/npm/v/@ripstop/web.svg )] ( https://www.npmjs.com/package/@ripstop/web )
7- [ ![ CI] ( https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yaml )
8- [ ![ license] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( LICENSE )
7+ <p align =" center " >
8+ <a href =" https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yml " ><img src =" https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yml/badge.svg " alt =" CI " ></a >
9+ <a href =" LICENSE " ><img src =" https://img.shields.io/badge/license-MIT-blue.svg " alt =" License: MIT " ></a >
10+ </p >
911
10- ## Install
12+ <p align =" center " ><b >Remote config, update walls and maintenance mode for web apps — signed at the edge, verified in the browser, 6.5 KB gzipped.</b ></p >
13+
14+ ## Installation
15+
16+ ` @ripstop/web ` is not on npm yet. Until it is, install straight from GitHub —
17+ the package builds itself on install:
1118
1219``` bash
13- npm install @ ripstop/ web
20+ npm install github: ripstop-dev/ripstop- web
1421```
1522
16- ## Quickstart
23+ Once it is published this becomes the ` npm install @ripstop/web ` you expected.
24+
25+ ## Quick start
1726
1827``` ts
1928import { Ripstop } from ' @ripstop/web' ;
@@ -67,6 +76,19 @@ const limit = ripstop.value('upload_limit', 10);
6776Always pass a fallback. On a first load with no network there is no payload yet
6877— that is the fail-open path working as intended.
6978
79+ ## API
80+
81+ | | Default | |
82+ | --- | --- | --- |
83+ | ` apiKey ` | — | Your app's public SDK key. Safe to ship |
84+ | ` appVersion ` | — | The build you are running; rules evaluate against it |
85+ | ` locale ` | ` en ` | Which wall copy to resolve; falls back to ` en ` per key |
86+ | ` minFetchInterval ` | 6 hours | How long a payload is fresh enough to skip the network |
87+ | ` timeoutMs ` | 5000 | Fetch budget. After that, cache |
88+ | ` storage ` | localStorage | Swap for ` MemoryStorage ` , sessionStorage, your own |
89+ | ` signingKeys ` | pinned | Override for self-hosted deployments and tests |
90+ | ` fetchImpl ` | global | Inject your own for tests or a proxy |
91+
7092## What it does when things break
7193
7294| Situation | What your app does |
@@ -82,19 +104,6 @@ The cache is re-verified every time it is read. This matters more on the web
82104than anywhere else: ` localStorage ` is two keystrokes away in devtools, so a
83105cache that were trusted would make every wall a polite request.
84106
85- ## Options
86-
87- | | Default | |
88- | --- | --- | --- |
89- | ` apiKey ` | — | Your app's public SDK key. Safe to ship |
90- | ` appVersion ` | — | The build you are running; rules evaluate against it |
91- | ` locale ` | ` en ` | Which wall copy to resolve; falls back to ` en ` per key |
92- | ` minFetchInterval ` | 6 hours | How long a payload is fresh enough to skip the network |
93- | ` timeoutMs ` | 5000 | Fetch budget. After that, cache |
94- | ` storage ` | localStorage | Swap for ` MemoryStorage ` , sessionStorage, your own |
95- | ` signingKeys ` | pinned | Override for self-hosted deployments and tests |
96- | ` fetchImpl ` | global | Inject your own for tests or a proxy |
97-
98107## SSR
99108
100109` Ripstop.init ` runs anywhere ` fetch ` exists. Without ` localStorage ` it falls
0 commit comments