You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-17Lines changed: 20 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,26 @@ with the following properties:
25
25
|`fetcher`| An implementation of a [fetch-compatible]https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API module for making HTTP requests (defaults to `globalThis.fetch`) | No |
26
26
|`siteID`| The Netlify site ID |**Yes**|
27
27
28
+
### Example
29
+
30
+
```javascript
31
+
importassertfrom'node:assert'
32
+
import { Blobs } from'@netlify/blobs'
33
+
34
+
conststore=newBlobs({
35
+
authentication: {
36
+
token:'YOUR_NETLIFY_AUTH_TOKEN',
37
+
},
38
+
siteID:'YOUR_NETLIFY_SITE_ID',
39
+
})
40
+
41
+
awaitstore.set('some-key', 'Hello!')
42
+
43
+
constitem=awaitstore.get('some-key')
44
+
45
+
assert.strictEqual(awaititem.text(), 'Hello!')
46
+
```
47
+
28
48
### Authentication
29
49
30
50
Authentication with the blob storage is done in one of two ways:
@@ -59,23 +79,6 @@ Authentication with the blob storage is done in one of two ways:
0 commit comments