---
source_url: https://www.pubnub.com/docs/migration-guides/app-context
title: Migrate from Objects v1 to App Context
updated_at: 2026-09-30T07:20:08.000Z
---

# Migrate from Objects v1 to App Context

## 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.

Objects v1 is no longer supported on any current PubNub SDK. If your integration still calls an Objects v1 method, such as `createUser`, `createSpace`, or `join`, move it to [App Context](https://www.pubnub.com/docs/data-storage/metadata/overview.md), PubNub's current metadata storage for users, channels, and memberships. There's no compatibility window. An SDK version that supports App Context doesn't also support Objects v1, so you can't run both on the same client.

## Before you start

Confirm you have:

* An existing integration that calls Objects v1 methods.
* The Subscribe key for the keyset you're migrating, from the [Admin Portal](https://admin.pubnub.com/).
* App Context must be enabled on the keyset before you call it, and new keysets don't enable it by default.

## Migrate with an AI coding assistant

If you use an AI coding assistant, paste this prompt into it to replace your Objects v1 calls. The prompt makes the assistant read this guide, list every Objects v1 call first, and stop until you confirm whether PubNub Support has finished moving your stored data. Do the PubNub Support request in [Request migration of your existing data](#request-migration-of-your-existing-data) yourself.

```text
Migrate this codebase from PubNub Objects v1 to App Context.

1. Read the migration guide first:
   https://www.pubnub.com/docs/migration-guides/app-context.md
   If the PubNub MCP server is connected, you can call get_general_migration_guide
   instead. Where the guide and your own knowledge of PubNub SDKs disagree,
   follow the guide and tell me.
2. Before you edit anything, list every Objects v1 method call, such as
   createUser, updateSpace, join, or addMembers. Also list every Objects v1 event
   listener and the PubNub SDK version of each client. Then show me a plan and
   wait for my approval.
3. STOP and ask me two things before you change code. First, is App Context
   enabled on the keyset? Second, do we need the existing Objects v1 data, and
   has PubNub Support finished moving it? An SDK upgrade doesn't move that data,
   and App Context can't read it until Support finishes.
4. There's no compatibility window. An SDK version that supports App Context
   doesn't support Objects v1, so replace every Objects v1 call on a client in
   the same change.
5. Map each method with the tables in the guide. The names in the guide are
   JavaScript SDK names, so confirm the exact name for each platform.
6. Replace each space with a plain channel name.
7. App Context has no updateMemberships or updateMembers. Call setMemberships or
   setChannelMembers again with the fields you want to change.
8. Replace the separate Objects v1 event handlers with one App Context event
   listener that branches on the type field.
9. After each change, run the build and tests and show me the output.
10. Never put the PubNub secret key in client code, and never commit keys or
    credentials.
11. When you finish, list every file you changed and the steps left for me.
```

## Request migration of your existing data

When you upgrade your SDK to a version that supports App Context, it doesn't move your existing Objects v1 data for you. If you want to keep that data, request the move yourself:

1. Go to [PubNub Support](https://support.pubnub.com) and open a request.
2. Include the Subscribe key for the keyset from the [Admin Portal](https://admin.pubnub.com/).

There's no charge for this migration. Once PubNub Support completes it, that data is reachable only through the App Context methods below, not from Objects v1 SDK methods or REST calls. Request it early, since you need the move finished before you can read that data through App Context.

## Replace Objects v1 methods with App Context methods

App Context also replaces the Objects v1 concept of a "space" with a plain [channel](https://www.pubnub.com/docs/architecture/core-concepts.md#channel). Anywhere your integration created a space, use a channel name instead. You don't need to give a channel its own App Context metadata record just to publish or subscribe on it.

Update your code to call the App Context method for each Objects v1 method it currently calls:

### User metadata methods

| Objects v1 method | App Context method |
| --- | --- |
| `createUser` | `setUUIDMetadata` |
| `updateUser` | `setUUIDMetadata` |
| `deleteUser` | `removeUUIDMetadata` |
| `getUser` | `getUUIDMetadata` |
| `getUsers` | `getAllUUIDMetadata` |

### Channel metadata methods

| Objects v1 method | App Context method |
| --- | --- |
| `createSpace` | `setChannelMetadata` |
| `updateSpace` | `setChannelMetadata` |
| `deleteSpace` | `removeChannelMetadata` |
| `getSpace` | `getChannelMetadata` |
| `getSpaces` | `getAllChannelMetadata` |

### Membership methods

| Objects v1 method | App Context method |
| --- | --- |
| `join` | `setMemberships` |
| `leave` | `removeMemberships` |
| `getMemberships` | `getMemberships` |
| `addMembers` | `setChannelMembers` |
| `removeMembers` | `removeChannelMembers` |
| `getMembers` | `getChannelMembers` |

App Context has no `updateMemberships` or `updateMembers` method. Call `setMemberships` or `setChannelMembers` again with the fields you want to change instead.

The method names above use the JavaScript SDK. Confirm the exact name for your platform in [Available SDKs](https://www.pubnub.com/docs/sdks.md), or work from the current examples in each how-to:

:::note User ID / UUID
User ID is also referred to as **UUID/uuid** in some APIs and server responses but **holds the value** of the **userId** parameter you [set during initialization](https://www.pubnub.com/docs/architecture/core-concepts.md).
:::

* [Set, get, and remove user metadata](https://www.pubnub.com/docs/data-storage/metadata/manage-user-metadata.md)
* [Set, get, and remove channel metadata](https://www.pubnub.com/docs/data-storage/metadata/manage-channel-metadata.md)
* [Set, get, and remove memberships](https://www.pubnub.com/docs/data-storage/metadata/manage-memberships.md)
* [Set, get, and remove members](https://www.pubnub.com/docs/data-storage/metadata/manage-members.md)

## Move to the unified event format

Objects v1 delivered a separate event type for each kind of change. App Context replaces them with one event, delivered to a single listener, carrying `event`, `type`, and `data` fields that tell you what changed and on which entity. Register that listener the same way you register any other [event listener](https://www.pubnub.com/docs/pub-sub/subscribe/event-listeners.md), and update your handler to branch on `type` instead of listening for several separate event names. Refer to [App Context events](https://www.pubnub.com/docs/data-storage/metadata/events.md) for the full payload shape and your SDK's exact handler pattern.

## Related tasks

* [App Context](https://www.pubnub.com/docs/data-storage/metadata/overview.md). The three entity types App Context stores and how membership connects them.
* [App Context events](https://www.pubnub.com/docs/data-storage/metadata/events.md). The complete event payload and per-SDK listener patterns.
* [Set, get, and remove user metadata](https://www.pubnub.com/docs/data-storage/metadata/manage-user-metadata.md). Current SDK examples for the user-metadata methods in this guide.
* [Set, get, and remove channel metadata](https://www.pubnub.com/docs/data-storage/metadata/manage-channel-metadata.md). Current SDK examples for the channel-metadata methods in this guide.
* [Available migration guides](https://www.pubnub.com/docs/migration-guides/overview.md). Every migration guide in the current documentation.

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