Get Started With Taskless
Install Taskless
Section titled “Install Taskless”Taskless works with your existing languages and tools. You can install the loader using your preferred package manager.
Using a different framework other than what's shown ?
You can switch the framework you're viewing docs for:
npm install @taskless/loader
pnpm add @taskless/loader
yarn add @taskless/loader
Install Packs
Section titled “Install Packs”Taskless packs are collections of reusable code, designed to inspect your requests and responses & report back to your app about what they see. Built in WebAssembly, Packs are fully sandboxed and safe to run within your application context.
For this guide, we’ll just get the taskless/pack-core
pack, which provides basic APM functionality; this is similar to output you’d use for DataDog, Honeycomb, and other APM tools.
npx @taskless/pack install https://github.com/taskless/pack-core/releases/download/v0.0.7/pack.tgz
pnpx @taskless/pack install https://github.com/taskless/pack-core/releases/download/v0.0.7/pack.tgz
yarn dlx @taskless/pack install https://github.com/taskless/pack-core/releases/download/v0.0.7/pack.tgz
Modify Your “Start” Command
Section titled “Modify Your “Start” Command”Once you’ve downloaded the Taskless Client, you’ll need to integrate it with your existing project. In most projects, this involves adding Taskless to your application’s “start” command, before any code runs.
{ "name": "my-next-js-app", "scripts": { "dev": "next dev", "build": "next build", "start": "NODE_OPTIONS=\"--import=@taskless/loader\" next start" }}
{ "name": "my-nest-app", "scripts": { "dev": "nest dev", "build": "nest build", "start": "NODE_OPTIONS='--import=@taskless/loader' nest start" }}
{ "name": "my-express-app", "scripts": { "start": "node --import=@taskless/loader server.js" }}
{ "name": "my-hono-app", "scripts": { "dev": "tsx watch src/index.ts", "build": "tsc", "start": "node --import=@taskless/loader dist/index.js" }}
{ "name": "my-react-router-app", "scripts": { "build": "react-router build", "dev": "react-router dev", "start": "NODE_OPTIONS=\"--import=@taskless/loader\" react-router-serve ./build/server/index.js", "typecheck": "react-router typegen && tsc" }}
{ "name": "my-node-app", "scripts": { "start": "node --import=@taskless/loader server.js" }}
{ "name": "my-node-app", "scripts": { "start": "node --import=@taskless/loader server.js" }}
Start Your Application: Instantly Better Logs
Section titled “Start Your Application: Instantly Better Logs”When you start your application, you’ll begin seeing new ndjson
output in your console. This output is Taskless’ way of reporting back to you about the requests and responses it sees.
{"requestId":"0198ac4dce3a72289ad844186c3f3f5e","dimensions":[{"name":"core/domain","value":"open.kickbox.com"},{"name":"core/url","value":"https://open.kickbox.com/v1/disposable/mailinator.com"},{"name":"core/path","value":"/v1/disposable/mailinator.com"},{"name":"core/durationMs","value":"92"},{"name":"core/status","value":"200"}]}{"requestId":"0198ac4dce3a72289ad8487ac5af5609","dimensions":[{"name":"core/domain","value":"open.kickbox.com"},{"name":"core/url","value":"https://open.kickbox.com/v1/disposable/mailinator.com"},{"name":"core/path","value":"/v1/disposable/mailinator.com"},{"name":"core/durationMs","value":"187"},{"name":"core/status","value":"200"}]}{"requestId":"0198ac4f1315733a88d2f7c5503abb9d","dimensions":[{"name":"core/domain","value":"api.artic.edu"},{"name":"core/url","value":"https://api.artic.edu/api/v1/artworks/129884"},{"name":"core/path","value":"/api/v1/artworks/129884"},{"name":"core/durationMs","value":"1375"},{"name":"core/status","value":"200"}]}
Do I need any additional infrastructure?
No, Taskless is designed to work inside your existing application context.
This way you don’t have to figure out kubernetes, create lambda sidecars, or
stand up additional machines.
What is the performance overhead of Taskless?
Taskless tries to do as much as possible asynchronously and locally to minimize the performance impact
to your app. The WebAssembly overhead is typically less than 1ms.
When your application starts and you are using Taskless Cloud for requests (via an API key), your configuration will be downloaded from the Taskless Cloud if it isn’t already cached. The overhead of this request is typically 100-200ms.
What happens if Taskless is unavailable?
When your configuration and integrations are running locally, Taskless will continue to function even if the service isn’t available.
If you are retrieving or sending data to Taskless Cloud, Taskless takes a “fail open” approach. This means that our default behavior is to let requests fall through to your application’s built-in network requests.