2) Build a full-stack Miro app
In this training you leverage the Miro Web SDK and REST API to create a full-stack Miro app.
Time to complete
~45 minutes
Recommended onboarding tasks
Learning objective
After completing this training module, you'll be able to:
- Understand how to enable REST API authentication from Miro's Web SDK authorization
- Construct a full stack application using Miro's Web SDK for a frontend experience, and Miro's REST API for backend actions
- Create an API handler endpoint within the Miro NextJS boilerplate app
Training Companion Guide
View text summary
[00:20 - 01:22]
- Training overview
- Miro developer platform guided onboarding
[01:20 - 01:40]
- Recommended onboarding tasks
- Recap: Create your 1st Miro app locally
[02:04 - 04:18]
- Web SDK + REST Authorization
- A “fullstack” Miro app is an app that uses both the Web SDK and REST API
- Diagram: end to end flow
- Why use joint authorization?
- Ensure that end users don’t have to authorize the Web SDK and REST API separately
[04:20 - 08:06]
- Developer App Settings
- “Use this URI for SDK authorization”
- Enable the SDK and REST API authorization to communicate seamlessly
- Demo: Enable developer settings
- Run app from the console
- Authorize from the UI
- Log OAuth2.0
code
in the console to demonstrate where REST authorization is - kicked off during authorization from the frontend (Web SDK)
- Recap: Joint authorization in action
- “Use this URI for SDK authorization”
[08:10 - 10:34]
- Web SDK: Create images
- Leveraging
createImage()
method in the Web SDK to create an image - Demo: create image on click
- In
index.tsx
, create ansdkHandler()
function to create an image - onClick, button calls
sdkHandler()
- In
- Leveraging
[10:36 - 15:55]
- REST API: Read images
- Leverage REST API endpoint, GET Image to read image details
- Demo: create a REST API handler
- In
index.tsx
, create arestHandler()
function to call our backend - Create a
restRequest.ts
endpoint under pages > api in our NextJS app- Call the Miro API client from the initMiro file in our boilerplate
- GET board details, and retrieve images from the board
- Back in
index.tsx
, retrieve the content we’re calling in our backend (restRequest.ts
) in a newasync function apiCall()
- Expose these details in the frontend console
- onClick, image details sent to the frontend console via the REST API
- In
- Recap: REST API
- Created an API Handler endpoint
- Leveraged the Miro API Client in our NextJS boilerplate
- Called our API Handler from the frontend
- REST API Reference App
- Similar example, Webhooks Manager sample app
[15:58 - 17:05]
- Learning summary
- Miro’s learning paths
- Authorization overview
- Developer App Settings
- Web SDK
- REST API
- Guided learning path preview
Associated skills
By following this training, you become familiar with these concepts and skills:
- Create a sample app with npm:
create-miro-app
- Web SDK board methods
- Web SDK board methods:
createStickynote()
- REST API
- Enable REST API authentication from Miro's Web SDK authorization
See also
- Sample App: Webhooks Manager
Updated 12 months ago
What's next