Connect a Frontend to a Move Package
In the previous guide, "Hello, World!", you deployed a Move package and interacted with it to create an object that stored the text "Hello world!".
This guide demonstrates how to connect a React interface to that "Hello, World!" package, giving any user a way to interact with the Move package from their browser and set a custom greeting.
- Prerequisites
-
Complete the "Hello, World!" guide and have your published Move package's ID.
-
Install
pnpmto use as the package manager. -
Create a Slush wallet.
Call the Move package
First, confirm that you have followed the "Hello, World!" example guide and are within the sui-stack-hello-world/move/hello-world directory in your CLI.
Then, verify your Move package is still available on Testnet by obtaining its object information:
$ sui client object <PACKAGE_ID>
Replace <PACKAGE_ID> with your Move package's ID.
If your package no longer exists, or if you need to obtain the package ID again, follow the steps in the "Hello, World!" guide.
View the frontend source code
In the "Hello, World!" example project, the subdirectory sui-stack-hello-world/ui contains the frontend interface source code files:
.
├── eslint.config.js
├── index.html
├── package.json
├── pnpm-lock.yaml
├── prettier.config.cjs
├── src