---
source_url: https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/overview
title: Modules and libraries
updated_at: 2026-09-30T07:20:08.000Z
---

# Modules and libraries

## Documentation index

To discover more PubNub resources:

1. Fetch [PubNub's llms.txt](https://www.pubnub.com/llms-full.txt) for a list of available pages in Markdown format.
2. Identify relevant URLs from that index.
3. Fetch the target pages.

Do not assume a path exists, always check the index first.

This page lists every built-in JavaScript module available inside a [PubNub Function](https://www.pubnub.com/docs/message-processing/serverless/development.md). For conceptual guidance on the runtime and its trigger types, see [Functions](https://www.pubnub.com/docs/message-processing/serverless/overview.md). For per-execution operation caps (XHR requests, KV store operations, PubNub API calls, chain depth), see [API limits](https://www.pubnub.com/docs/serverless-sdk/api-limits.md).

Load a module with `require()`. No package installation step is needed. The Functions runtime does not support native Node.js modules, npm packages, the `process` global, or WebSocket connections. See [Built-in modules](https://www.pubnub.com/docs/message-processing/serverless/overview.md#built-in-modules) for what the runtime supports instead.

| Module | `require()` name | Description |
| --- | --- | --- |
| [kvstore](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/kvstore.md) | `kvstore` | Persistent key-value store scoped to your subscribe key. |
| [xhr](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/xhr.md) | `xhr` | Outbound HTTP and HTTPS requests. |
| [pubnub](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/pubnub.md) | `pubnub` | PubNub client SDK capabilities and Functions-specific publishing methods. |
| [crypto](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/crypto.md) | `crypto` | Hashing, HMAC, signing, and verification. |
| [vault](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/vault.md) | `vault` | Read-only access to secrets stored on your keyset. |
| [jwt](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/jwt.md) | `jwt` | Creates and verifies JSON Web Tokens. |
| [uuid](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/uuid.md) | `uuid` | Generates RFC-compliant UUIDs. |
| [codec](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/codec.md) | `codec/auth`, `codec/base64`, `codec/query_string` | Basic Auth headers, Base64, and query-string encoding and decoding. |
| [jsonpath-plus](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/jsonpath-plus.md) | `jsonpath` | Queries JSON documents and JavaScript objects with JSONPath expressions. |
| [advanced_math](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/advanced-math.md) | `advanced_math` | Distance calculation and degrees-to-radians conversion. |
| [utils](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/utils.md) | `utils` | Random integer generation and numeric type checking. |
| [ugc](https://www.pubnub.com/docs/serverless-sdk/modules-and-libraries/ugc.md) | `ugc` | Moderates user-generated content inline against an Auto Moderation configuration. |

## Related reference

* [Functions](https://www.pubnub.com/docs/message-processing/serverless/overview.md). What each trigger type does and when to use it.
* [Function types](https://www.pubnub.com/docs/serverless-sdk/function-types.md). Per-trigger reference for every Function type.
* [Request and response objects](https://www.pubnub.com/docs/serverless-sdk/request-response-objects.md). Every field and method on the `request`, `response`, and `event` objects a handler receives.
* [API limits](https://www.pubnub.com/docs/serverless-sdk/api-limits.md). Per-execution operation caps, including XHR requests, KV store operations, PubNub API calls, and chain depth.

Last updated at: 2026-09-30T07:20:08.000Z
