Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert @nangohq/node to @nangohq/js -- remove node dependencies #2068

Open
lawrencecchen opened this issue Apr 29, 2024 · 1 comment
Open

Comments

@lawrencecchen
Copy link

I'm using Cloudflare Workers/Durable Objects and can't use the nango client libraries due to axios and other uses of node:crypto. I've been using a fetch wrapper instead:

async function nangoProxy(input: ProxyConfiguration) {
  return await fetch(`https://api.nango.dev/proxy/${input.endpoint}`, {
    headers: {
      "Content-Type": "application/json; charset=utf-8",
      Authorization: `Bearer ${env.NANGO_SECRET_KEY}`,
      "Provider-Config-Key": input.providerConfigKey ?? "",
      "Connection-Id": input.connectionId ?? "",
    },
    body: JSON.stringify(input.data),
    method: input.method,
  }).then((r) => r.json());
}

It would be great if the official library becomes edge compatible as well.

Copy link

linear bot commented Apr 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant