Select spec version:

RudderTyper v1 Quickstart

Install RudderTyper v1, generate a client from a Tracking Plan, and connect it to a RudderStack SDK.
Available Plans
  • free
  • growth
  • enterprise

RudderTyper v1 (npm) is in maintenance mode and will not receive any new features.

For TypeScript, Kotlin, and Swift support, use RudderTyper v2.

Get started

The following sections will help you set up and use RudderTyper to generate your first client.

Prerequisites

The workspace-level Service Access Token has Read permissions by default. You do not need to assign any resource permissions while generating the token.

Token permissions for legacy RBAC system

If you are on the legacy Permissions Management (RBAC) system, your workspace-level Service Access Token should have Viewer permission.

See this documentation for more information on generating the token.

workspace-level Service Access Token with Viewer permission

Quickstart

The following steps highlight the process of creating a ruddertyper.yml file and generate your first RudderTyper client with the specified configuration details:

  1. Run the following command to initialize RudderTyper:
bash
$ npx rudder-typer init  # Or initialize or quickstart
  1. Choose the SDK type for your RudderTyper client - you can use the up/down arrow key to navigate through the options.
Choose SDK for RudderTyper client
  1. Choose the appropriate language and continue. The following image shows the language options for the Web SDK:
Choose language option
  1. Enter the workspace-level Service Access Token generated above. RudderTyper uses this token to fetch all the Tracking Plans present in your workspace.

  2. Choose the Tracking Plan for which RudderTyper generates the client - this plan is automatically saved locally in a plan.json file.

Choose Tracking Plan
  1. Choose the RudderTyper mode. You will see two options - Production or Development. See RudderTyper modes for more information on each mode.

  2. Specify the directory to store the generated RudderTyper client. You can choose an existing directory or create a new one, depending on your requirement.

Choose directory to store the client
  1. Review the settings and select Looks good! to complete the process. You can select Edit to make any changes to the above steps.
Review settings

RudderTyper then generates the client based on your configuration settings and stores it in the specified directory. See Configuration reference for more information on the ruddertyper.yml file structure.

Generated RudderTyper client

Troubleshooting

  • If you get an error during the setup process, run the following commands to clear your cache and local storage:
bash
npm cache clean --force
rm -r ~/.ruddertyper
  • If you get a “Your workspace does not have any Tracking Plans” error during the setup, verify that your RudderTyper client is on a stable version (v1.x).

Integrate RudderTyper client with SDK

This section includes the steps to integrate your RudderTyper-generated client with your app across different RudderStack SDKs.

  1. Import all files in the client generated by RudderTyper as a package in your project.
  2. Make the calls using the RudderTyper client, as shown:
java
// Import your auto-generated RudderTyper client:
import com.rudderstack.generated.*

  // Issue your first RudderTyper track call
  RudderTyperAnalytics.with(this).orderCompleted(
    OrderCompleted.Builder()
    .orderID("ck-f306fe0e-cc21-445a-9caa-08245a9aa52c")
    .total(39.99)
    .build()
  );

See more

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.