The project is in a healthy, maintained state
Library for interacting with Cloudflare Workers KV Storage and configuring connection from a Rails application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

CloudflareStorage

CloudflareStorage is a simple gem for interacting with the Cloudflare Workers KV Storage from a Rails application.

It was designed to let you get started with minimal configuration.

Installation

Add this line to your application's Gemfile:

gem 'cloudflare_storage'
```

And then run:

```bash
bundle
```

Or install it yourself:

```bash
gem install cloudflare_storage 
```

## Usage

Configure credentials with an initializer. For example:
```ruby
# config/initializers/cloudflare_storage.rb
CloudflareStorage.configure do |config|
    config.account_id = Rails.application.credentials.cloudflare.account_id
    config.namespace_id = Rails.application.credentials.cloudflare.namespace_id
    config.token = Rails.application.credentials.cloudflare.token
  end
end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/geetotes/cloudflare_storage.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Alternatives

There are other gems out there that encompass the whole of the Cloudflare API. You should look to those if you're planning on using more than just Workers KV storage in your project.

* [Cloudflare](https://github.com/socketry/cloudflare)
* [Rubyflare](https://github.com/trev/rubyflare)