Code Monkey home page Code Monkey logo

bento-node-sdk's People

Contributors

connorlindsey avatar hellokashif avatar jessehanley avatar jonsherrard avatar shadyendless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bento-node-sdk's Issues

Runtime UnhandledPromiseRejection

Hey @jessehanley @shadyendless, facing issues when using the bento library in a node app. I'm not able to pin point to where the error is coming from but this is what I get when I call bento.V1.addSubscriber
image

Here's the Bento config which is calling addSubscriber
image

Can you please help sort this out. Thanks

Error with bento.V1.track: realFetch.call is not a function

I reported this in the Discord on May 5th, and creating an issue as requested. ๐Ÿ˜Š

When attempting to use this sdk in a Next.js Server Action passed into a <form> (related docs), I get a realFetch.call is not a function error.

Here's the code:

'use server';

import { Analytics } from '@bentonow/bento-node-sdk';

const bento = new Analytics({
  authentication: {
    publishableKey: process.env.BENTO_PUBLISHABLE_KEY,
    secretKey: process.env.BENTO_SECRET_KEY,
  },
  logErrors: false,
  siteUuid: process.env.BENTO_SITE_UUID,
});

const submitFormAction = async (formData: FormData) => {
  await bento.V1.track({
    type: 'test-node-sdk',
    email: '[email protected]',
    fields: {},
  })
    .then((res) => {
      console.log('RESULT', res);
    })
    .catch((err) => {
      console.log('ERROR', err);
    });
};

Here's the trace from the track call:

ERROR TypeError: realFetch.call is not a function
    at module.exports (webpack-internal:///(action-browser)/./node_modules/isomorphic-fetch/fetch-npm-node.js:8:19)
    at eval (webpack-internal:///(action-browser)/./node_modules/@bentonow/bento-node-sdk/dist/bento-node-sdk.esm.js:1357:62)
    at new Promise (<anonymous>)
    at BentoClient.post (webpack-internal:///(action-browser)/./node_modules/@bentonow/bento-node-sdk/dist/bento-node-sdk.esm.js:1354:12)
    at BentoBatch._callee2$
    at tryCatch
    at Generator.invoke [as _invoke]
    at Generator.eval [as next]
    at asyncGeneratorStep
    at _next
    at eval
    at new Promise (<anonymous>)
    at BentoBatch.eval
    at BentoBatch.importEvents
    at BentoAPIV1._callee6$
    at tryCatch
    at Generator.invoke [as _invoke]
    at Generator.eval [as next]
    at asyncGeneratorStep
    at _next
    at eval
    at new Promise (<anonymous>)
    at BentoAPIV1.eval
    at BentoAPIV1.track

This is an issue with breadcrumbs for fixing: matthew-andrews/isomorphic-fetch#194

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.