Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom bindings for cloud-prem (part 1) #868

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

threepointone
Copy link
Contributor

Instead of having to provision resources directly from the config, we'd like to bind to existing resources in users' CF accounts. For example, you have an R2 bucket that you'd like to access from your partykit project. Now, you can add this to your partykit.json:

{
  //...
  "bindings": {
    "r2": {
      "myBucket": "my-bucket-name"
    }
  }
}

Inside your project, you can now access the r2 bucket with room.context.bindings.r2.myBucket (or lobby.bindings.r2.myBucket).

We'll add more types of bindings in the near future.

Instead of having to provision resources directly from the config, we'd like to bind to existing resources in users' CF accounts. For example, you have an R2 bucket that you'd like to access from your partykit project. Now, you can add this to your `partykit.json`:

```jsonc
{
  //...
  "bindings": {
    "r2": {
      "myBucket": "my-bucket-name"
    }
  }
}
```

Inside your project, you can now access the r2 bucket with `room.context.bindings.r2.myBucket` (or `lobby.bindings.r2.myBucket`).

We'll add more types of bindings in the near future.
Copy link

changeset-bot bot commented Apr 10, 2024

🦋 Changeset detected

Latest commit: 6485472

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
partykit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
partykit-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 1:22pm
partykit-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 1:22pm
partykit-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 1:22pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant