Comments (9)
Sorry for the inconvenience @nvuillam - we'll work rightaway to get the @amplitude/utils onto the registry. As for the multiple http calls, we're looking to use the batch endpoint as the default on an open pr (along with some logic for retrying events in the correct order).
from amplitude-node.
Is there any example/doc about how to use this feature? (multiple events in one HTTP call)
from amplitude-node.
mmmm I see that this package looks much more advanced, and already provides requested feature ....
https://github.com/geoffdutton/amplitude
I'll try to use it and tell here if i still need the enhancement ! ( i started to do it but npm install
fails because package @amplitude/utils is not available on npm registry )
from amplitude-node.
I made some tests using amplitude npm package, it seems to work for now :)
But as your library seems more lightweight, I may switch back to it once you publish an update :)
from amplitude-node.
Thanks @nvuillam ! We're looking forward to having an update soon. While we are discussing having mutliple events being sent in logEvent, it's also good to note that logEvent
by default (in the new version) waits until the next event loop to batch and send all the events its collected - so as to avoid many many http calls. You can also set the option for it to wait even longer for the batch time to increase and send more events at a time.
from amplitude-node.
Hi @nvuillam - the 1.0.2 behavior is for events to be batched by logEvent
and not be sent until a certain amount of time passes, or flush
is called - I think this might be a suitable solution for your use?
from amplitude-node.
Is the HTTP request done by a separate node instance ? If not, it could be not ok for CLIs , because it wouldn't exit until such batch is processed
from amplitude-node.
@nvuillam apologies for the late response!
It's using setTimeout
to wait some number of seconds in the same node instance, so the concern here is valid. We're adding optioning to make the timings of these waits more configurable - what do you think? We'll also start looking into putting some of this logic in separate node instances.
also, the base optioning is to wait 0 ms - to the next event loop.
from amplitude-node.
While logEvent
does batching under the hood, it's a little bit counter intuitive when we actually care about the response body.
My understanding it calls this API https://developers.amplitude.com/docs/batch-event-upload-api , which makes my response handlers a little bit confusing to write
from amplitude-node.
Related Issues (20)
- Not compatible with Webpack 5 (Next.js 11) HOT 9
- Doesn't work with Next.js in APIs (events seem sent but aren't available on Amplitude dashboard) HOT 9
- Identify event taking too long to resolve HOT 3
- Node.js example has a bug for ES5 HOT 1
- requestTimeoutMillis breaks 1.8.0 -> 1.8.1 HOT 5
- How should I generate the device ID ? HOT 6
- User properties inheritance HOT 6
- UnhandledRejection when amplitude server is unavailable
- includeUtm HOT 1
- ChainAlert: new npm maintainer has published version 1.10.0 of package @amplitude/utils
- ChainAlert: new npm maintainer has published version 1.10.0 of package @amplitude/types
- Getting host verification error while installation npm install amplitude/node HOT 1
- Where can I see the event log in amplitude? HOT 1
- Can we send batch/bulk events at once HOT 1
- 📣 Introducing NEW Amplitude SDK for Node.js [BETA]
- Not compatible with Webpack 5 (Next.js 11) (fix)
- maj tslib to next major HOT 5
- How to track revenue? HOT 3
- insert_id parameter in amplitude android sdk
- Test Issue ticket creation in AMP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplitude-node.