Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 3 additions & 76 deletions src/components/OryHeroDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,7 @@ const OryHeroDemo = () => {
const terminalRef = useRef(null)

const script = [
// CLI setup
{ type: "comment", text: "# One-time project setup via Ory CLI", delay: 0 },
{ type: "command", text: "brew install ory/tap/cli", delay: 300 },
{ type: "output", text: "Installing ory...", delay: 500 },
{ type: "success", text: "✓ Installed", delay: 600 },
{ type: "command", text: "ory auth", delay: 400 },
{
type: "output",
text: "Opening browser to create your Ory developer account...",
delay: 500,
},
{ type: "success", text: "✓ Authenticated as <your-email>", delay: 700 },
{ type: "command", text: 'ory create project --name "MyApp"', delay: 400 },
{ type: "output", text: "Project slug: myapp-abc123", delay: 600 },
{ type: "success", text: "✓ Project created", delay: 200 },

// API registration
{ type: "comment", text: "# Register a user via Ory API", delay: 600 },
{
type: "note",
text: "Note: Traits depend on your identity schema. This sample uses Ory's 'username' preset schema.",
delay: 400,
},
{ type: "command", text: "curl -s -X GET \\", delay: 300 },
{
type: "command-cont",
text: ' "https://<YOUR_PROJECT_SLUG>.projects.oryapis.com/self-service/registration/api"',
delay: 100,
},
{
type: "output",
text: '{ "id": "<FLOW_ID>", "type": "api", "expires_at":"...","issued_at":"...","request_url":"<YOUR_PROJECT_SLUG>/self-service/registration/api","ui":{"action":"<YOUR_PROJECT_SLUG>.projects.oryapis.com/self-service/registration?flow=<FLOW_ID>","method":"POST", ... } }',
delay: 500,
},
{ type: "command", text: "curl -s -X POST \\", delay: 400 },
{
type: "command-cont",
text: ' -H "Content-Type: application/json" \\',
delay: 100,
},
{
type: "command-cont",
text: ' -d \'{"traits":{"username":"<YOUR_USERNAME>"},"password":"<YOUR_PASSWORD>","method":"password"}\' \\',
delay: 100,
},
{
type: "command-cont",
text: ' "https://<YOUR_PROJECT_SLUG>.projects.oryapis.com/self-service/registration?flow=<FLOW_ID>"',
delay: 100,
},
{
type: "output",
text: '{"identity":{"id":"...","schema_id":"preset://username","schema_url":"<YOUR_PROJECT_SLUG>.projects.oryapis.com/schemas/cHJlc2V0Oi8vdXNlcm5hbWU","state":"active", ... } }',
delay: 600,
},
{ type: "success", text: "✓ User registered!", delay: 400 },
{
type: "link",
text: "Create your free project via Ory Console →",
url: "https://console.ory.sh/",
delay: 300,
},
{ type: "command", text: "npm install @ory/elements-react @ory/nextjs", delay: 300 },
]

const runDemo = async () => {
Expand Down Expand Up @@ -255,8 +194,7 @@ const OryHeroDemo = () => {
{/* Initial prompt when empty */}
{lines.length === 0 && !isRunning && (
<div style={{ color: "#67e8f9" }}>
<span style={styles.prompt}>$</span> From zero to registered user
in minutes! Click 'Run'.
<span style={styles.prompt}>$</span>{" "}
</div>
)}

Expand Down Expand Up @@ -320,21 +258,10 @@ const OryHeroDemo = () => {
...(isRunning ? styles.runButtonDisabled : styles.runButton),
}}
>
{isRunning ? "Running..." : hasRun ? "Run Again" : "Run"}
Try it
</button>
{hasRun && !isRunning && (
<button
onClick={reset}
style={{ ...styles.button, ...styles.resetButton }}
>
Reset
</button>
)}
</div>
</div>

{/* Caption */}
<p style={styles.caption}>From zero to registered user in minutes.</p>
</div>
)
}
Expand Down
Loading
Loading