Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Atlas

Integrate with Vercel

Vercel is a development platform that simplifies application deployments. Vercel has a marketplace for developers to discover software packages and provision applications.

Use the instructions on this page to:

  • Get started with Vercel and MongoDB Atlas and build your next project with MongoDB Atlas.

  • Choose from Free, Dedicated, and Flex MongoDB clusters, with options for every use case.

You can integrate with Vercel in the following ways:

  • Native Integration

    In this mode, you locate MongoDB Atlas in Vercel Marketplace, and create a new MongoDB Atlas account with billing conducted through Vercel. A Native Integration of MongoDB Atlas in Vercel allows you to:

    • Provision Atlas resources directly from the Vercel dashboard, with billing managed through your Vercel account. You can also directly access resources in Atlas through a provisioned linked account.

    • Deploy MongoDB Atlas clusters for new and existing Vercel applications.

    After you create MongoDB Atlas clusters, Vercel adds your Atlas cluster credentials and other settings to your Vercel environments. To learn more about the Native Integration, see Vercel Native Integration.

  • Connectable Accounts Integration

    This mode guides you through setting up an account in Atlas to connect your existing Vercel projects.

    The Connectable Accounts Integration mode allows you to link an existing Atlas account to your Vercel account, but requires that you manage your Atlas account, billing, and creation of resources outside of the Vercel UI. By comparison, the Native Integration mode allows you to create and manage Atlas resources directly from the Vercel UI, with billing managed through your Vercel account.

    Important

    While the Connectable Accounts Integration continues to be supported, we recommend that you use it only to connect existing Atlas resources to Vercel. To use Vercel and MongoDB Atlas together for new Atlas resources, and for the best developer experience, use the Vercel Native Integration.

If you are a Vercel user with any role, you can discover Atlas through the following methods:

1

Under the Overview tab locate the Add new button in the upper right corner and from the drop-down, select Integration.

2

In the left-side list, select Any Type and Any Category. Use the Search panel at the top of the page to search for MongoDB and then select MongoDB Atlas in the list of Native Integrations.

3

In the left-side list of all integrations in Vercel Marketplace, select Categories > Storage and then select MongoDB Atlas in the list of Native Integrations.

The integration with Vercel requires that you:

You can link one Atlas cluster to more than one project in Vercel.

  • If you create a Native Integration of Atlas in Vercel, Atlas creates a new Vercel-managed organization and project in Atlas for you.

  • If you use a Connectable Accounts Integration of Atlas with Vercel, you must have one or more projects in your personal or team Vercel account before you can link them to Atlas clusters.

The list of Vercel projects that you can choose for the integration depends on the user or team scope.

Vercel deployments use dynamic IP addresses.

To connect to an Atlas cluster, the IP access list of your Atlas cluster must allow all IP addresses (0.0.0.0/0). If Atlas doesn't find an entry for 0.0.0.0/0 in your Atlas project's IP access list, Atlas adds it on your behalf, as part of the integration workflow.

  • If you use a Native Integration of Atlas with Vercel, Atlas creates a database user in the following format: Vercel-Admin-[name of resource] in the admin database and grants the built-in readWriteAnyDatabase MongoDB database role to all other non system databases in the Atlas cluster. For example, if your Vercel resource is named my-first-atlas-cluster, the database user that Atlas creates is Vercel-Admin-my-first-atlas-cluster.

  • If you set up the Connectable Accounts Integration of Atlas with Vercel, Atlas secures your Vercel connections to the cluster as follows: Atlas creates a MONGODB_URI environment variable that serves as the Atlas cluster's connection string for all Vercel projects that you link this cluster to.

    When your application doesn't specify a database, the MONGODB_URI variable uses /myFirstDatabase as the default database name. Replace this name with your database name, or if you use a library to interface with MongoDB, ensure that your application's code specifies your database name.

    Atlas creates a database user, vercel-admin-user, in the admin database and grants the built-in readWriteAnyDatabase MongoDB database role to all other non system databases in the Atlas cluster.

You can create a Native Integration of Atlas in Vercel Marketplace to provision Atlas resources directly from the Vercel dashboard, with billing managed through your Vercel account. You can also directly access resources in Atlas through a provisioned linked account.

Atlas provisions the account for you if you don't have one. The Atlas account is linked to the Vercel installation. You have separate credentials for logging into Atlas.

The following considerations apply to the Native Integration of Atlas in Vercel. In addition, see Considerations that apply to both integration modes.

  • Resource Mapping

    A "team installation" in Vercel maps to an organization in Atlas. An installed product (resource) in Vercel maps to a project and cluster in Atlas.

  • API Access

    Vercel requires programmatic access to Atlas APIs to create and manage resources on behalf of users and to propagate environmental changes.

  • User Provisioning and Account Linking

    Atlas provisions new Atlas user accounts for Vercel users, links existing accounts, and sends a password reset email if you don't configure Atlas credentials. User authentication requires Atlas credentials to access Atlas.

    The user who initially installs the Atlas Native Integration for the Vercel team becomes the Atlas Organization Owner.

  • Accessing |service| from Vercel

    You can navigate to Atlas UI from Vercel via an Open in Atlas button. After logging in with your Atlas credentials, Atlas redirects you to the corresponding Atlas resource.

    • Users with existing Atlas accounts. When accessing Atlas from Vercel, Vercel prompts users with existing Atlas accounts to confirm linking their Atlas account to their Vercel installation. After the users confirm the linkage and log in with Atlas credentials to prove their identity, Atlas links the users' Atlas accounts to their Vercel installation.

    • New users. Atlas provisions an account for new users and sends a password reset email so that users can configure their passwords and prove their identity. Once Atlas obtains the user's credentials, Atlas links the user's Atlas account to their Vercel installation and grants this user the Organization Owner role in Atlas. Atlas keeps organization's permissions in line with the permissions in Vercel. Vercel's "Admin" and "User" roles map to Organization Owner and Organization Read Only roles in Atlas, respectively.

    If any user in the Vercel team installs additional Atlas clusters using the Native Integration, Atlas doesn't automatically add these users to the Atlas organization created for the Vercel team. The Atlas organization owner must ensure that all Vercel team users who need access to the Atlas organization have it. This also applies to new Vercel team users who join the Vercel team after the initial installation of the Native Integration.

    Use one of the following methods to ensure that Atlas adds additional Vercel team's users to the Atlas Organization:

    • Vercel team users can access the Atlas organization in the Atlas UI through the Vercel UI. if they're not already Atlas users, Atlas provisions accounts for them, with assignment to the Atlas organization for the Native Integration.

    • The Atlas Organization owner can invite Atlas users to the Atlas Organization.

  • Environment Variables

    The Native Integration automatically configures the MONGODB_URI environment variable for secure database connections. For the full list of environment variables, see the Vercel UI for the Native Integration of Atlas.

  • Billing

    The Vercel Native Integration creates a new Atlas Organization from the Vercel UI which is automatically connected to a Vercel Marketplace billing plan as the active payment method for the Atlas Organization. Billing occurs per one Atlas organization and includes a collective bill for all MongoDB Atlas clusters and services in the Organization. In Vercel and Atlas, you can see a confirmation of Vercel Marketplace billing for the Atlas Organization, as well as daily usage costs.

  • Security

    Atlas ensures secure connections via SCRAM authentication with IP allowlists for Atlas clusters that you create through the Native Integration in Vercel.

  • Deletion or Uninstallation of the Native Integration

    After uninstalling a Vercel integration, we recommend that the Atlas Organization owner ensures that access assignments and billing methods are up-to-date, and removes stale or unwanted access to prevent automated reminders from MongoDB regarding overdue billing payments. Atlas submits a final Vercel invoice for the Atlas to Vercel, and removes the Vercel Marketplace payment method from the Atlas Organization.

    This invoice is not a final Atlas invoice, as there might still be additional charges incurred by the Organization after uninstallation for the most recent usage that might not have been billed for yet. You are responsible for adding a new payment method to the Organization to ensure any outstanding usage can be paid for.

    You can't uninstall or unlink the Native Integration from the Atlas UI, although you can always delete your resources in Atlas. If you delete a Vercel-linked cluster, this is reflected in the Vercel UI.

  • Getting Started in Vercel UI for Next.js

    The Vercel UI for the Native Integration includes instructions for getting started with Next.js and Atlas.

  • Deployment templates

    The Vercel UI for the Native Integration includes deployment templates. These templates include example code and configuration files to help you get started with your Atlas projects in Vercel.

To add the MongoDB Atlas Native Integration in Vercel:

1
  1. Go to Vercel Marketplace and use search or left-side category filter for Storage to locate MongoDB Atlas in the list of Native Integrations.

  2. Click Install in the MongoDB Atlas page for the integration, or click Install in the upper right corner of the Vercel UI page for the integration.

2

Click Accept and Create.

3

Choose a Free, Flex, or Dedicated Atlas cluster:

  • Free ($0, Storage: 512 MB, RAM: Shared, vCPU: Shared)

  • Flex ($0.011/hour, Storage: Up to 5 GB, RAM: Shared, vCPU: Shared)

  • Dedicated ($0.08/hour, Storage: 10 GB, RAM: 2 GB, vCPU: 2xCPUs)

Important

Free clusters are available on all installation plans. Flex and Dedicated clusters are available only on Paid installation plans.

4

A list of Vercel regions displays. These regions map to MongoDB Atlas regions in most cases. If you choose a Vercel region that doesn't have a corresponding Atlas region, Atlas chooses the closest region to the Vercel region that you selected.

5
  • Free plan $0

    No credit card is required. You can only create Free MongoDB Atlas clusters with this plan.

  • Paid plan

    Credit card is required. You can create Free, Flex, and Dedicated clusters with this plan. You'll only be billed for Flex and Dedicated clusters.

If you choose a Flex or Dedicated Atlas cluster, the Free plan is grayed out. If any member of your Vercel team uses this Native Integration with a Free plan and chooses to create a Flex or Dedicated cluster, the plan changes to a Paid plan. Even if you uninstall a MongoDB Atlas cluster that isn't free, the plan remains as a Paid plan. To change the plan to a Free plan, uninstall the Native Integration and then install it again choosing a Free cluster and a Free plan. To learn how to uninstall any Native Integration, see the Vercel documentation.

6

Vercel generates a name that you can choose or you can enter your own name.

7
8

Vercel UI shows Initializing and then Available. This means that your MongoDB Atlas cluster is ready to use.

Now you can use the Native Integration of Atlas in Vercel to:

  • Connect to a Vercel project.

  • Pull your latest environment variables.

If you no longer need this MongoDB Atlas cluster, you can uninstall the Native Integration and by doing so delete a MongoDB Atlas database. For instructions, see the Vercel documentation.

You can also delete the database (the resource), without uninstalling the whole integration. This is useful in cases when you want to keep the integration around to create other resources in the future, or if you have other resources in the same integration.

If you delete a Vercel-linked Atlas cluster, any projects that you linked to this cluster in Vercel will no longer have access to this database cluster. Before proceeding with the uninstallation and deletion of the Atlas cluster, ensure that this Atlas cluster is no longer in use by any projects or application.

If you run into issues while using a Vercel Native Integration with MongoDB Atlas, contact Vercel Integration Support at MongoDB vercel-integation-support@mongodb.com.

Note

All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.

This procedure allows you to use an existing Atlas account, organization, project, and Atlas cluster for integration with Vercel.

To connect the serverless functions that you deployed in Vercel to Atlas clusters, you can also use the MongoDB Node.js driver or the Mongoose ODM library.

To integrate Vercel applications with Atlas clusters, you begin in the Vercel UI.

Note

You can add a Vercel integration as a personal account user and then add another Vercel integration as a team user. You can't change the scope of an existing integration from a personal account to a team level account in Vercel.

To switch from a MongoDB Connectable Accounts Integration for a personal Vercel account to an integration with a team scope in the same Atlas organization, disconnect an existing integration in Atlas, and add a new integration with a team scope.

1

Go to MongoDB Atlas Integration in Vercel and click Add integration.

2
  1. Choose one of the Vercel scopes from the drop-down menu:

    • Personal Account

    • Team

    After you set the scope for your integration, you can't change it. To switch to a scope that differs from your chosen scope, disconnect one integration and create another one using this procedure.

  2. Click Continue.

3

You can choose specific projects or all projects. You can later edit the integration to change the projects. The project list depends on the user or team scope that you specified in the previous step.

Select one of the following options:

  • All Projects

  • Specific Projects

4
  1. Choose one of the following options:

    • If you're using your Google Accounts, follow the steps for signing into it, or create a new Google account.

    • If you're using your email, it's already filled in and grayed out.

    • If your company uses federated authentication, use your company's email address. Proceed with the verification steps required for your federated user access.

    • If you already have an Atlas account, click Log in now. See Log in to Your Atlas Account.

  2. Enter your first and last names, and choose a password. A password must contain at least 8 characters, contain unique characters, numbers, or symbols, and not contain your email address. See Register a new Atlas Account.

  3. Click the checkbox I accept the Privacy Policy and the Terms of Service.

    Review the Terms of Service and the Privacy Policy.

5
  1. Select an Atlas organization from the drop-down, or create a new Atlas organization.

  2. Click Continue.

  3. Confirm access to your Atlas organization.

    Atlas creates an organization for you. Click I Acknowledge to confirm that you grant Vercel access to your Atlas organization.

    To remove access from this Vercel integration to your MongoDB Atlas organization, you must disconnect this integration.

  4. Select an Atlas project to integrate with Vercel from the drop-down, or create a new project.

6
7

Atlas sends you a confirmation email with the details of your integration. The integration window closes and you return to the Vercel UI where you can update the Vercel projects in this integration.

Note

All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.

To manage the Connectable Accounts integration with Vercel:

1

WARNING: Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Click the Organization Settings icon next to the Organizations menu.

    The Organization Settings page displays.

2

Click Integrations in the sidebar.

The Organization Integrations page displays.

Note

All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.

To link additional clusters in your organization to projects in Vercel:

Note

Use this procedure for an already configured Connectable Accounts integration.

1

WARNING: Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Click the Organization Settings icon next to the Organizations menu.

    The Organization Settings page displays.

2

Click Integrations in the sidebar.

The Organization Integrations page displays.

3

Select Vercel.

4

Click Link Clusters.

The Add Another Cluster Link with Vercel window opens and shows your Atlas organization.

  1. Select an Atlas project.

  2. In the left drop-down list, select a cluster not linked to Vercel. If your project doesn't have another Atlas cluster, you can create one.

  3. In the right drop-down list, select one or more Vercel projects.

  4. Click Save.

You receive a confirmation email from Atlas with the details of your integration.

A new linked Atlas cluster appears in the linked clusters list.

To link a cluster from another Atlas project in your organization to Vercel, repeat this procedure for that project.

Note

All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.

You can add or remove Vercel projects that you linked to an Atlas cluster.

1

WARNING: Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Click the Organization Settings icon next to the Organizations menu.

    The Organization Settings page displays.

2

Click Integrations in the sidebar.

The Organization Integrations page displays.

3

Select Vercel.

4

Atlas displays existing linked Vercel projects.

  1. Edit existing links, in the right-side list, choosing a project from the drop-down. You can:

    • Click next to a Vercel project in the list to add it to this cluster's integration.

    • Click to remove some Vercel projects from this integration.

5

Atlas asks you to confirm that you want to unlink the cluster from the projects. To confirm, click Unlink. Atlas removes the environment variables for Vercel projects that it created when you linked the projects to an Atlas cluster.

If you unlink all projects, Atlas behaves as follows. It:

  • Doesn't remove your data, database users, or IP access lists that you created for this integration.

  • Doesn't delete the cluster, or the integration, even though the Atlas UI might show that you have no linked clusters in your integration. To disable the integration, you must disconnect Vercel.

6

Note

All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.

Before you disconnect Vercel projects from Atlas clusters, to avoid downtime to any applications connected to the same Atlas clusters, verify that the cluster's users and network access rules don't share other projects and applications connected to this Atlas cluster.

1

WARNING: Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Click the Organization Settings icon next to the Organizations menu.

    The Organization Settings page displays.

2

Click Integrations in the sidebar.

The Organization Integrations page displays.

3

Select Vercel.

4

In this step, click to request Atlas to do these optional tasks for you:

  • Delete the database users created as part of this integration

  • Delete the network access rules created as part of this integration

5

Atlas asks you to confirm that you want to disconnect your Atlas organization from Vercel.

Disconnecting the integration may result in downtime for your Vercel applications and any other applications connecting to the Atlas clusters that you linked to Vercel.

To confirm, enter the words Disconnect Vercel in capital letters and then click Disconnect Vercel.

Atlas removes the integration by removing the environment variables for Vercel projects that it created when you linked the projects to an Atlas cluster.

Vercel also removes the integration and it no longer displays in the Vercel UI.

After you disconnect the Vercel integration, if you haven't deleted users or access lists, you can:

Note

When you remove an integration in the Vercel UI, Atlas also removes the integration and you don't need to disconnect the integration in the Atlas UI.

On this page