Skip to content

separate api and token storage contract #47

Open
@nosovk

Description

@nosovk

In current implementation we are dependent on file system, which could be not available in lots of environments.
Like: https://community.cloudflare.com/t/about-cloudflare-workers-filesystem/481642
There was a similar request for Firebase: #17

In firebase, you can get short living tempdir, but in Cloudflare you couldn't event that.

Proposed solution: migrate to interface based providers. Like:

sendpulse.init(API_USER_ID,API_SECRET,TOKEN_STORAGE,function() {
    sendpulse.listAddressBooks(console.log);
});

where TOKEN_STORAGE is an object or class, that implements simple api with two methods:
storage.get("key"), storage.set("key", value)
In that case we can provide different storage providers, without hard dependency on fs.

Or any other approach will be also ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions