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

Add UBB info #227

Merged
merged 10 commits into from
Jan 26, 2024
10 changes: 8 additions & 2 deletions packages/projects-docs/pages/learn/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
},
"sandboxes": "Sandboxes",
"legacy-sandboxes": "Legacy Sandboxes",
"-- Plans": {
"type": "separator",
"title": "Plans & Billing"
},
"plans": "Plans",
"credit-usage": "Credits & Usage",
"access": "Access",
"-- more": {
"type": "separator",
"title": "More"
},
"ci": "CodeSandbox CI",
"explore": "Explore Page & Curators",
"plans": "Plans and Billing"
"explore": "Explore Page & Curators"
}
4 changes: 4 additions & 0 deletions packages/projects-docs/pages/learn/access/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"workspace": "Workspaces",
"permissions": "User permissions"
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
---
title: User Permissions
description: How to manage access control in CodeSandbox Repositories
description: How to manage access control in your CodeSandbox workspace.
---

import { Callout } from 'nextra-theme-docs'

# User Permissions

Permissions vary slightly between repositories, which extend the settings from GitHub, and Sandboxes and Devboxes, which solely exist in CodeSandbox.

## Devboxes and Sandboxes
### Private
Private Devboxes and Sandboxes can only be accessed by workspace members who own the Sandbox or Devbox.

### Unlisted
Unlisted Sandboxes and Devboxes are accessible by workspace members and non-workspace members with the URL.

### Public
Public Sandboxes and Devboxes are visible to everyone. Public Sandboxes are a great option for sharing content with people outside the workspace. Non-workspace members are able to open and run public Sandboxes and Devboxes. In order to edit, however, they will need to fork the Sandbox or Devbox to their own workspace.

<Callout emoji="⚠️">
VMs used to run public Devboxes will be charged to the workspace that owns the Devbox.
</Callout>

If you want to share a Devbox publicly, consider turning it into a template. That way, the runtime of the VMs used to run the code and/or the preview won't be charged to your workspace.


Default privacy settings for Devboxes and Sandboxes can be set in the workspace portal in the [permissions tab](https://codesandbox.io/t/permissions)
![permissions](../images/permissions.png)


## Repositories

### Users with write access

Users with write access to a repository can enjoy the full feature set available on CodeSandbox Repositories.

### Users with read-only access

Users with read-only access to the repository can browse the content of the project, check the previews and even execute a few tasks. To introduce changes, they need to create a contribution branch or fork the repository. For more information, visit the [open source collaboration](/learn/getting-started/open-source) page.
Users with read-only access to the repository can browse the content of the repository, check the previews and execute a few tasks. To introduce changes, they need to create a contribution branch or fork the repository. For more information, visit the [open source collaboration](/learn/getting-started/open-source) page.

### Anonymous users

Users without a CodeSandbox Account can only browse the content of the project and interact with the previews.

Users without a CodeSandbox account can only browse the content of the project and interact with the previews.

## Feature comparative guide

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Currently, every account must be associated with at least one workspace. In the

## Collaboration on workspaces

You can add as many members to a workspace as you like. You can invite them when you are creating the workspace for the first time, or later through the subscription management view.
On Free, you are allowed up to 5 members on a workspace and on Pro, you are allowed 20 members. You can invite them when you are creating the workspace for the first time, or later through the subscription management view.

![Invite team members](../images/workspace-invite-members.png)

Expand All @@ -39,7 +39,7 @@ From there, they can accept or decline the invitation.

You can also invite workspace members who do not have a CodeSandbox account. They will be sent an email inviting them to create an account where they will have access to the workspace.

#### Collaborating on sandboxes
#### Collaborating on Sandboxes

Anyone with edit permissions to the workspace can edit its sandboxes.

Expand All @@ -50,7 +50,7 @@ If you want to collaborate live with workspace members, you can start a [live se

#### Collaborating on repositories

Similarly, anyone with edit access to the team workspace can edit its repositoriesas long as they also have write access to the repository on the git provider (such as GitHub). Branches have their own development environments for each workspace, so files saved on `my-branch` of a repository in your personal workspace will not appear on `my-branch` in the team workspace until they are committed and pushed to the git provider.
Similarly, anyone with edit access to the team workspace can edit its repositoriesas long as they also have write access to the repository on the git provider (such as GitHub). Branches have their own development environments for each workspace, so files saved on `my-branch` of a repository in your personal workspace will not appear on `my-branch` in the team workspace until they are committed and pushed to the git provider.

Live collaboration on branches is restricted to members of the same workspace. If you don't see your collaboration partners working, you may be looking at the same branch in a different workspace. Otherwise, your work will be visible in every workspace as soon as it is committed and pushed to the git provider.

Expand All @@ -74,31 +74,11 @@ Admins can edit team member access and roles here as well as edit the subscripti

![Team settings](../images/workspace-team-settings.png)

## Transitioned personal workspaces

As of Nov 12, 2023, all personal workspaces act as standard workspaces.
Previously, everyone who signed up for a CodeSandbox account would automatically have a personal workspace created for them.
This workspace would hold:
### Add or remove people from a workspace

- your account details
- your contribution branches
- all the sandboxes created in the workspace
1. Go to the [Dashboard](https://codesandbox.io/dashboard).
1. In the top left corner, select the **team** you'd like to edit in the dropdown.
1. Click on the **settings** icon next to the team.
1. Add or remove people through the **Members** section by inviting them via email or searching for their CodeSandbox username.

However, there was no option to add people to the workspace or upgrade the space.
With the recent changes, every workspace will be treated the same. This means that workspaces that were previously a Free Personal can do the following:

#### Add collaborators

Just like in a Pro workspace, you may add members to the workspace by navigating to the workspace settings, and either sending an invite URL or entering the email address of the member you wish to add (they will be notified by email).

#### Upgrade to Pro

Every workspace can now be upgraded. By selecting any action to upgrade from within a workspace, you will be able to remove free limitations from any workspace and access all Pro features on the sandboxes and repos that already exist in that space.

#### Access account details from any workspace

Account information is now held in a separate account view. You can access it from the main menu within `Preferences`.

<Callout emoji="⚠️">
If you have a legacy Personal Pro account, some of these options may vary.
</Callout>
5 changes: 3 additions & 2 deletions packages/projects-docs/pages/learn/ai/codeium.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ Codeium is an incredible AI-powered developer toolkit. Their code completion too

## Getting started

Codeium code completion is now available for free to every CodeSandbox user on [Devboxes](https://codesandbox.io/dashboard/recent?create_devbox=true).
Codeium code completion is now available for free to every CodeSandbox user on [Devboxes](https://codesandbox.io/dashboard/recent?create_devbox=true), [Sandboxes](https://codesandbox.io/s/) and repositories

If you have your AI settings enabled, you will get AI autocomplete working in your code immediately. Note that we disable AI permission toggles by default, so if you have not yet enabled them, you will have a chance to do so through our announcement interfaces or through the workspace settings.
If you have your AI settings enabled, you will get AI autocomplete working in your code immediately.
Note that we enable AI permission toggles by default on free workspaces. If you do not have have access to Codeium, visit the [workspace portal](https://codesandbox.io/t/permissions) and enable the AI settings

## Settings and configuration

Expand Down
5 changes: 5 additions & 0 deletions packages/projects-docs/pages/learn/credit-usage/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"credits": "Credits",
"monitoring-usage": "Monitoring usage",
"controlling-usage": "Controlling usage"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Controlling VM Usage
description: Learn more about how you can remain in control of VM usage in your CodeSandbox workspace.
---

import { Callout } from 'nextra-theme-docs'

# Controlling VM Usage

A workspace can control the use of virtual machines in several ways. The functionalities described below allow workspace admins to increase predictability of VM usage and credit spend.

## Privacy

VM runtime is billed to the workspace that owns the Devbox or Repository. VMs are required to run the code regardless of whether or not the code is being actively developed. This means that workspaces are responsible for the runtime of any project in their workspace, including running previews or spinning up the code for `read-only` users.

Making Devboxes private allows workspace admins to have finer control over total VM spending. For this reason, Devboxes are created as private by default. Devbox and Sandbox privacy defaults can be controlled via the `Permissions` tab in the [workspace portal](codesandbox.io/t/permissions).

## Templates

VM runtime for templates is covered by CodeSandbox. By setting a Devbox as a template, you can share your work without worrying about the costs associated with non-workspace users running your Devbox.
Once a Devbox is in a template state, it cannot be edited. If you want to continue making changes to the Devbox, you will need to switch it back out of template mode.

## VM settings

Each workspace has a range of VM sizes to choose from. The range of options varies depending on the subscription tier of the workspace.
By default, all Devboxes and repositories will run on [Micro](/learn/credit-usage/credits). The default VM size can be changed on the VM [settings page](codesandbox.io/t/vm_settings) in the workspace portal.

![VM settings page](../images/vm-settings.png)

Individual Devboxes or repositories can be set to run on VMs other than the default.
To set the VM of a Devbox or repositority, you can create a rule. This helps ensure that heavy compute projects get the power they need without increasing VM usage across the other projects.

![VM Rule](../images/vm-rule.png)


## Spending limit
On-demand credits will never exceed the spending limit.
Once subscription credits are used, the VMs will start running on on-demand credits. These credits will be aggregated and added to the end-of-month invoice.

Every Pro workspace is required to have a maximum spending limit to ensure that there are no surprise bills at the end of the billing cycle.
The spending limit is initially set during the Pro subscription check-out flow. Workspace admins can adjust this spending limit in the workspace portal at any time.

Once the on-demand credits hit that limit, all Devboxes and Repositories will enter a [frozen state](/learn/plans/pricing-faq#my-devbox-is-frozen-what-does-that-mean) until more credits have been added or the next billing cycle begins.
44 changes: 44 additions & 0 deletions packages/projects-docs/pages/learn/credit-usage/credits.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Credits
description: Learn more about how CodeSandbox uses credits for usage-based billing.
---

import { Callout } from 'nextra-theme-docs'

# Credits

Credits serve as the unit of measurement for VM runtime. They simplify understanding and managing the costs of running your Devboxes and Repositories. One credit equates to a specific amount of resources used per hour, which ensures clarity and transparency in your billing.

| VM size | Credits / hour | Cost / hour | CPU | RAM |
| ------ | -------------- | ----------- | -------- | ------ |
| Nano | 10 credits | $0.18 | 2 cores | 4 GB |
| Micro | 20 credits | $0.36 | 4 cores | 8 GB |
| Small | 40 credits | $0.72 | 8 cores | 16 GB |
| Medium | 80 credits | $1.44 | 16 cores | 32 GB |
| Large | 160 credits | $2.88 | 32 cores | 64 GB |
| XLarge | 320 credits | $5.76 | 64 cores | 128 GB |

<Callout emoji="ℹ️">
Sandboxes do not run on VMs, so any time spent on a Sandbox will not count toward your credit spend.
</Callout>

## Types of credits

### Subscription credits
Subscription credits are allocated monthly credits per workspace according to the subscription plan. A workspace on the free plan gets 400 credits per month. The Pro plan has a base of 1000 credits a month, but more can be purchased with credit add-ons.

<Callout emoji="ℹ️">
Unused credits do not roll over month-to-month.
</Callout>

### On-demand credits
Once subscription credits have been used, VM usage will begin running on on-demand credits. These credits will be tracked and billed at the end of the billing cycle.
On-demand credits are not subject to discount and are billed at a standard $0.18 per hour.

To prevent unexpected bills due to unusually high on-demand credit usage, every Pro workspace is required to set a [spending limit](/learn/credit-usage/controlling-usage#spending-limit).






Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Monitoring VM Usage
description: How to have visibility over how VMs are being used in your CodeSandbox workspace.
---

import { Callout } from 'nextra-theme-docs'

# Monitoring usage

VM usage is reported in the workspace portal under the [virtual machine usage tab](https://codesandbox.io/t/usage).
In this view, you can find information about the workspace credit spend during the current cycle as well as logs from each session.

![VM Rule](../images/vm-usage.png)

## Understanding VM starts and stops

There are two different ways to wake up a VM:
- Through user interaction, such as spinning up a repository branch in the editor.
- Through automated jobs like making an HTTP wake-up call to start up a preview.

These job-related starts usually add up to a few minutes of VM time in a billing cycle. They are accounted for in the VM usage logs in the workspace portal.

CodeSandbox automatically uses hibernation timeouts to conserve VM use. If a VM has not had any interactivity for 30 minutes, it will hibernate until woken up again.
2 changes: 1 addition & 1 deletion packages/projects-docs/pages/learn/devboxes/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"overview": "Overview",
"your-first-sandbox": "First-Time Setup",
"your-first-sandbox": "Getting Started",
"embedding": "Embedding",
"secrets": {
"title": "Secrets",
Expand Down
28 changes: 0 additions & 28 deletions packages/projects-docs/pages/learn/devboxes/editors.mdx

This file was deleted.

10 changes: 5 additions & 5 deletions packages/projects-docs/pages/learn/devboxes/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { Callout } from 'nextra-theme-docs'

# CodeSandbox Devboxes

CodeSandbox provides two development environments that are ideal for prototyping and rapid web development: [Devboxes](/learn/devboxes/overview) (which run in a microVM) and [Sandboxes](/learn/sandboxes/templates) (which run using browser resources).
CodeSandbox provides two development environments that are ideal for prototyping and rapid web development: [Devboxes](/learn/devboxes/overview) (which run in a virtual machine (VM)) and [Sandboxes](/learn/sandboxes/templates) (which run using browser resources).

We generally recommend using Devboxes, which provide all the tooling needed for building prototypes. Sandboxes are mostly useful as a playground for basic front-end JavaScript projects.

Previously known as Cloud Sandboxes, Devboxes are a great way to work on any type of project, regardless of its language or size. Devboxes run [microVMs](/learn/environment/vm) and leverage our memory snapshotting to spin up an environment in 1.5 seconds. They have built-in [Docker support](/learn/environment/docker) and include several valuable features, such as [AI](/learn/ai/overview), collaborative [Terminals](/learn/repositories/terminal), [Tasks](/learn/repositories/task), and [VS Code integration](/learn/getting-started/setting-up-vscode).
Previously known as Cloud Sandboxes, Devboxes are a great way to work on any type of project, regardless of its language or size. Devboxes run [VMs](/learn/environment/vm) and leverage our memory snapshotting to spin up an environment in 1.5 seconds. They have built-in [Docker support](/learn/environment/docker) and include several valuable features, such as [AI](/learn/ai/overview), collaborative [Terminals](/learn/repositories/terminal), [Tasks](/learn/repositories/task), and [VS Code integration](/learn/getting-started/setting-up-vscode).

<Callout>
Devboxes are built for scale. Our Free plan includes generous VM specs but you can easily [start a Pro trial](https://codesandbox.io/pro) to improve them.
Expand All @@ -26,14 +26,14 @@ To create a new Devbox, you can clone a template from our ["Create Devbox"](http
<Tabs tabs={["Devbox", "Sandbox"]}>
<WrapContent>
## What is a Devbox?
Unlike Sandboxes that run on your browser, Devboxes run on our [microVMs](/learn/environment/vm).
Unlike Sandboxes that run on your browser, Devboxes run on our [VMs](/learn/environment/vm).

Devboxes are great for prototyping any type of project in any programming language. They can run both backend and front-end services.
You can learn more about the editor and the unique functionalities of the cloud developer environment in [Repositories](/learn/repositories/overview).
You can learn more about the editor and the unique functionalities of the cloud developer environment in [repositories](/learn/repositories/overview).

Like Sandboxes, Devboxes are free to use.

Devboxes run on microVMs, which brings two features that make them great for prototyping:
Devboxes run on VMs, which brings two features that make them great for prototyping:

1. Fast cloning. You can fork Devbox [within 2 seconds](https://codesandbox.io/blog/how-we-clone-a-running-vm-in-2-seconds) and continue with an exact clone of the microVM. This way, you can quickly test multiple approaches to your prototype.
2. Instant resume. When you connect to a Devbox, it will wake up within 1 second and continue with your running dev server. This way, you can quickly continue prototyping.
Expand Down
Loading
Loading