bentonow / bento-node-sdk Goto Github PK
View Code? Open in Web Editor NEW๐ฑ Bento Node SDK and tracking library
License: MIT License
๐ฑ Bento Node SDK and tracking library
License: MIT License
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
Here's the Bento config which is calling addSubscriber
Can you please help sort this out. Thanks
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.