Skip to content

A Short-Lived Disposable Settings API

Sometimes we just need a quick way to persist some data without getting into creating a dedicated data store. Or maybe we just don't want to pollute an existing storage with temporary data that is ephermal in nature and we only need for a short little while. Demo apps, mock ups, proofs of concept... are all use cases for this service.

Well, say hello to prefs.us!

  • No accounts. No logins.
  • No databases to create and manage.
  • Inactive data purged automatically.
  • Set your own TTL on any piece of data.
  • Organize your data by projects, domains, lists.
  • All data stored encrypted.


Include prefs.us in your project

<script src="https://prefs.us/prefs.us.js"></script>

Get API token

prefs_us.apitoken("mytoken#1", "['user','pass','salt']");

Write data

prefs_us.key("user-data").write('{"score":"200", "level":"3" }');
prefs_us.list("signups").write("jane.doe@somewhere.com");

Read data (Callback)

prefs_us.list("signups").read( (data) => {
        console.log(data.values);
    });

Read data (Promise)

prefs_us.read()
    .then( (response) => response.json())
    .then((data) => {
        console.log(data.values);
    })
    .catch( (error) => {
        console.log(error);
    });