Skip to content

Libraries

Method Parameters Description
getkey String, String Retrieve an API key or create one.
using String Specify an existing key to use.
project String Assign data to a project by name.
domain String Assign data to a domain.
subdomain String Assign data to a subdomain.
list String Directive to store data in a list.
read [Callback] Retrieves data. Callback is optional.
Returns Promise or Null if valid callback is supplied.
write String Stores data using HTTP GET
post text/plain Stores data using HTTP POST

JavaScript


Include prefs.us Javascript library in your project

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


Get the API key ready. All data will be linked to that key. Get as many keys as you need. The method below will either return the existing key or create a new one.

    const apikey = prefs_us.getkey('chosen-key-id', 'chosen-seed-phrase');


Use .using(apikey) method to specify the API key if already have one pre-generated.

    prefs_us.using('abcd...apikey...cd0f8);

PHP

TODO: PHP code and examples

Python

TODO: python code and examples

Java


Import prefsus.jar in your project

    import com.gorny.prefsus


Get the API key ready. All data will be linked to that key. Get as many keys as you need. The method below will either return the existing key or create a new one.

    PrefsUs prefs = new PrefsUs();
    String apikey = prefs.getkey('chosen-key-id', 'chosen-seed-phrase');
    //
    // use or store the API key somewhere safe
    //


Use .using(apikey) method to specify the API key if already have one pre-generated.

    PrefsUs prefs = new PrefsUs("abcd...apikey...cd0f8");