---
source_url: https://www.pubnub.com/docs/serverless/functions/functions-in-admin-portal
title: Functions in Admin Portal
updated_at: 2026-05-22T11:08:29.654Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Functions in Admin Portal

Functions run your code on PubNub's global network. You avoid servers and extra latency from external callouts. Processing is low-latency and real-time.

Packages group related Functions. Revisions capture changes. Deploy Revisions to keysets.

## Packages

:::tip Public Admin Portal demo
Want to browse through the Admin Portal without creating an account? Explore it through the [Public Demo](https://demo-admin.pubnub.com/) that shows examples of most PubNub features for transport and logistics use case.
:::

Before creating a Function, you must create a Package for it.

![Packages list](https://www.pubnub.com/assets/images/packages-list-394b75540ea95f4977cfa7891ed24751.png)

Packages from scratch are labeled `Custom`. Packages from integrations are labeled `Template`.

## Functions

Provide a Function name, an [event type](https://www.pubnub.com/docs/serverless/functions/overview#event-types) that triggers it, and a channel. You can use a 2-level [wildcard](https://www.pubnub.com/docs/general/channels/subscribe#wildcard-subscribe), like `foo.*`. The asterisk (*) matches one segment, for example `foo.bar`.

:::tip Channel selection
Use wildcards to cover more channels. Functions v2 supports up to 5 deployments (free) or 30 (paid) per Package Revision across keysets.
:::

![Create Function window](https://www.pubnub.com/assets/images/create-function-window-4765ba59e62b21e25f61f7b1455422eb.png)

Once a Package is created, you can also open its specific Revision and add or delete Functions to/from it.

![Create &amp; delete function buttons](https://www.pubnub.com/assets/images/create-delete-function-buttons-c9a24ccfdfd712343c26027ddfbdc6b9.png)

### Test Functions

The **Debug** tab in the Function's editor lets you test the Function by sending a sample payload and analyzing the response.

![Debug tab](https://www.pubnub.com/assets/images/debug-tab-193b9a19eb17ff2c9e65b54409d16bd2.png)

#### Export logs through Events & Actions

Any running Function publishes its logs to an internal channel following the pattern `output-rev-{{functionRevisionId}}-key-{{keysetId}}`, like `output-rev-NSPiAuYKsWSxJl4yBn30-key-abc123` (you can find this channel name in the Console output).

A Function publishes only the first 250 log lines per replica. By default, there is 1 replica in each region, and there are 5 regions, which gives a total of up to 1250 log lines.

To retain logs, export them with [Events & Actions](https://www.pubnub.com/docs/serverless/events-and-actions/overview) via [Webhook](https://www.pubnub.com/docs/serverless/events-and-actions/actions/create-webhook-action) or [S3](https://www.pubnub.com/docs/serverless/events-and-actions/actions/create-s3-action).

To do that, follow these steps:

1. Set up an event listener to listen for events on the internal channel. Provide the following configuration and enter the correct output-rev-* channel from the Console output in the Condition value field.
2. Create either a Webhook or S3 action and add the created event listener to it. When configuring this action, you can use the Batching feature to send multiple events in a single request.

## Revisions

A Package can have many Revisions (versions of the Package).

The first Revision is created automatically. Saving code or event type changes creates a new Revision.

## Deployments

Deploy a Revision to run a Function. Test in one Revision; deploy another to production.

![Deployments list](https://www.pubnub.com/assets/images/deployments-list-1fc014204b918ace2b52003fb37864ca.png)

Select the keysets where the Functions run.

A Revision can deploy to up to 50 keysets. This is a fixed limit per Revision.

## Permissions

Your level of access to Functions depends on the [role](https://www.pubnub.com/docs/portal/my-account#role-permissions) you are assigned in the Admin Portal.

If you want to assign another user access to Functions on your account, you must assign them either the Functions developer or the Functions viewer role. This user must already have one of the standard roles assigned to their account: Account Admin, App Viewer, App Admin, Key Viewer, Key Admin.

See the permissions table below for allowed actions:

| Permission | Functions developer | Functions viewer |
| --- | --- | --- |
| View Packages | Yes | Yes |
| View Revisions | Yes | Yes |
| View deployments | Yes | Yes |
| Create Packages | Yes | No |
| Update Packages (rename) | Yes | No |
| Create Revisions | Yes | Yes |
| Update Revisions (rename) | Yes | No |
| Assign Revisions to keysets (create deployments) | Yes | No |
| Import Packages from the Integrations Catalog and assign to keysets (create deployments) | Yes | No |
| Manage secrets on keysets | Yes | Yes |
| Start deployments | Yes | No |
| Stop deployments | Yes | No |
| Rolling update deployments | Yes | No |
| Delete deployments | Yes | No |
| Delete Revision | Yes | No |
| Delete Package | Yes | No |

## Terms in this document

* **Package** - A Functions v2 container that groups Functions, tracks Revisions, and is deployed to keysets.
* **PubNub** - PubNub is a real-time messaging platform that provides APIs and SDKs for building scalable applications. It handles the complex infrastructure of real-time communication, including: Message delivery and persistence, Presence detection, Access control, Push notifications, File sharing, Serverless processing with Functions and Events & Actions, Analytics and monitoring with BizOps Workspace, AI-powered insights with Illuminate.
