Skip to content

Compatible with isomorphic client? #16

@jamesarosen

Description

@jamesarosen

Question / Problem

Is the Vercel edge integration compatible with the isomorphic JavaScript library?

The docs for configuring with Vercel's Edge runtime say to use PluggableStorage and ErrorLogger, but neither is exported from @splitsoftware/splitio.

Why I Care / Use-Case

I have a Vercel application that includes some code that runs on the Edge runtime and some in the Serverless (Node) runtime. I use feature flags in both runtimes. I want the logic for handling feature flags to be consistent across the two runtimes and I don't want to maintain two implementations / integrations with Split.

Both packages declare the same SplitIO Typescript namespace, which results in collisions like this one:

split-io-js-vs-browser

Background

The public API for javascript-client has diverged from the one for javascript-browser-client. For example,

// javascript-client:
const factory = SplitFactory({
  core: {
    authorizationKey: 'YOUR_SDK_KEY'
  }
});

var client = factory.client();

// ...

client.getTreatment('user id', 'treatment name')

versus

// javascript-browser-client:
const factory = SplitFactory({
  core: {
    authorizationKey: 'YOUR_SDK_KEY',
    key: 'user id',
  }
});

var client = factory.client();

// ...

client.getTreatment('treatment name')

See also splitio/javascript-client#781

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions