How to write with resource token by JS client library, @influxdata/influxdb3-client?

Hi.

I tried the JS client library, @influxdata/influxdb3-client. I found that it uses v2 api in client.write(). But I could not find a way to write successfully with a resource token defined for the database. The code is very simple. It is something like the following.

await client.write(line, database, “”, { precision: “ms”});

The token is specified when client is initialized. This works with the admin token. I tried v3 api with a resource token by using curl, which was successful. Therefore, setting about the token should be correct. The server version is influxdb3 3.8.0 of Enterprise at-home.

If there’s a way to exec client.write() successfully with a resource token, let me know.

Thanks in advance.

Hi @nao,

Can you show how your code looks like?

Here is an example how to use the client for simple writes: influxdb3-js/examples/basic/src/index.ts at 57a649c89e7777cb1c02d817a548e12f8f5db022 · InfluxCommunity/influxdb3-js · GitHub

Best Regards

I am sorry. It was my mistake. It worked. One letter of the token was missing.

Thank you.