---
agentTools:
  projectIndex: https://nativescript-batch.readme.io/llms.txt
---

# batchId

Gets the ID of the underlying batch.

[block:code]
{
  "codes": [
    {
      "code": "import Batch = require(\"nativescript-batch\");\n\nvar b = Batch.newBatch(function(ctx) {\n    console.log(\"Batch ID: \" + ctx.batchId);\n});\n\nb.batch.id = \"MyBatch\";\n\nb.start();",
      "language": "javascript"
    }
  ]
}
[/block]