Skip to main content
PocketBase provides several utility namespaces and functions to help you build robust applications.

HTTP client

The $http namespace provides methods for making HTTP requests.

Basic request

POST request with JSON

POST with FormData

Handle response

Security utilities

The $security namespace provides cryptographic and security functions.

Hashing

Secure comparison

Random strings

Encryption

JWT tokens

Cron jobs

Schedule recurring tasks with cron expressions.

Basic cron job

Cron expressions

Remove cron job

Date and time

DateTime object

Date manipulation

Timezone

Type conversion

toString

toBytes

unmarshal

Arrays

arrayOf

Sleep

Context

Create Go context objects for API calls:

Validation

ValidationError

API errors

Create proper HTTP error responses:

Environment variables

Examples

Webhook integration

Rate limiting

API key authentication