@everymundo/cloudflare-kv
v0.0.3
Published
Easily provision KV namespaces and its values on Cloudflare [Serverless Components](https://github.com/serverless/components).
Downloads
44
Maintainers
Readme
Cloudflare KV
Easily provision KV namespaces and its values on Cloudflare Serverless Components.
1. Install
$ npm install -g @everymundo/cloudflare-kv
2. Create
$ mkdir demo && cd demo
Just create a serverless.yml
file
$ touch serverless.yml
$ touch .env # your CF credentials
# .env
CF_ACCOUNT_ID=
CF_EMAIL=
CF_KEY=
CF_TOKEN=
3. Configure
Create a serverless.yml
file:
# serverless.yml
name: test
stage: dev
plugins:
- serverless-dotenv-plugin
test:
component: "@everymundo/cloudflare-kv"
inputs:
namespace: mydomain.com
values:
- key: key1
value: vakue1
- key: key2
value: value2
Use the environment variables CF_ACCOUNT_ID
, CF_EMAIL
and CF_KEY
or CF_TOKEN
to specify your Cloudflare API credentials.
4. Deploy
$ severless
$
New to Components?
Checkout the Serverless Components repo for more information.