tencent cloud


Apache Pulsar SDK for Node.js

Last updated: 2024-06-28 11:33:56


    TDMQ for Apache Pulsar 2.7.1 and above clusters already support Apache Pulsar SDK for Node.js. This document describes how to access the SDK.


    Get the access address Copy the access address on the Cluster Management page in the TDMQ for Apache Pulsar console.
    Get the token Configure the role and permission as instructed in Role and Authentication and get the token of the role.


    1. Install the Node.js client in your client environment as instructed in Pulsar Node.js client.
    $ npm install pulsar-client
    2. In the code for creating the Node.js client, configure the prepared access address and token.
    const Pulsar = require('pulsar-client');
    (async () => {
    const client = new Pulsar.Client({
    serviceUrl: 'http://*', // Replace with the access address (copied from the **Cluster Management** page in the console)
    authentication: Pulsar.NewAuthenticationToken("eyJh**"), // Replace with the token
    await client.close();
    For how to use various features of the Apache Pulsar SDK for Node.js, see Pulsar Node.js client.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support