Prepare Your Org to Access the Models API
Learning Objectives
After completing this unit, you’ll be able to:
- Sign up for an AI Playground.
- Authorize your AI Playground in Visual Studio Code.
- Create a Salesforce DX Project.
Before You Start
Before you complete the steps in this unit, make sure you complete the badge, Quick Start: Lightning Web Components. The first two steps of that badge walk through setting up your Salesforce DX development environment, which you’ll need for this project.
The Next Step for DreamHouse Realty
After planning her first AI project with DreamHouse Realty, Maria needs to set up her org and environment so that she can begin building her dashboard. The Models API is accessible from any org with Einstein Generative AI and Data Cloud enabled.
Sign Up for a Trial Org with Einstein Generative AI
To complete this project, you need a special, 14-day custom playground that contains Einstein AI and Data Cloud.
- If you haven't already, click the checkbox: I can receive a password email at the beginning of the unit.
- Click Create Playground.
- Follow the prompts.
If you haven’t already, launch your AI playground.
- Click the gear icon () and click Setup. The Setup page opens in a new tab.
- In the Quick Find search box, type
Einstein Setup
.
- Click Einstein Setup to open the Einstein Setup page.
- Turn on Einstein to use generative AI features across your Salesforce Org.
Create a Project
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Type
SFDX
.
- Select SFDX: Create Project.
- Press Enter to accept the standard option.
- Enter
ModelsAPILWC
as the project name.
- Press Enter.
- Select a folder to store the project.
- Click Create Project. You should see something like this as your base setup.
Connect Your Visual Studio Code Environment
Before you can create a Lightning web component, you must connect your AI Playground to your VS Code environment.
Authorize Your AI Playground
In VS Code, authorize your custom Playground.
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Type
SFDX
.
- Select SFDX: Authorize an Org.
- Press Enter to accept the Project Default login URL option.
- Press Enter to accept the default alias. This opens the Salesforce login in a separate browser window.
- Log in using your AI Playground credentials.
- If prompted to allow access, click Allow.
- After you authenticate in the browser, the CLI remembers your credentials. The success message should look like this:
Now that you have set up your environment, you’re ready to start building the dashboard.