Skip to content
Open
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
6 changes: 6 additions & 0 deletions examples/with-passphrase-encrypt-export/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NEXT_PUBLIC_BASE_URL="https://api.turnkey.com"
NEXT_PUBLIC_AUTH_PROXY_URL="https://authproxy.turnkey.com"
NEXT_PUBLIC_EXPORT_IFRAME_URL="https://export.turnkey.com"

NEXT_PUBLIC_ORGANIZATION_ID="<your-organization-id>"
NEXT_PUBLIC_AUTH_PROXY_ID="<your-auth-proxy-id>"
41 changes: 41 additions & 0 deletions examples/with-passphrase-encrypt-export/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
36 changes: 36 additions & 0 deletions examples/with-passphrase-encrypt-export/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
18 changes: 18 additions & 0 deletions examples/with-passphrase-encrypt-export/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);

export default eslintConfig;
7 changes: 7 additions & 0 deletions examples/with-passphrase-encrypt-export/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
29 changes: 29 additions & 0 deletions examples/with-passphrase-encrypt-export/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "with-passphrase-encrypt-export",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --webpack",
"build": "next build",
"start": "next start",
"lint": "eslint"
},
"dependencies": {
"next": "16.1.6",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@turnkey/react-wallet-kit": "workspace:*",
"@turnkey/iframe-stamper": "workspace:*",
"@turnkey/sdk-types": "workspace:*",
"@types/node": "20.3.2",
"@types/react": "19.2.3",
"@types/react-dom": "19.2.3",
"eslint": "^9",
"eslint-config-next": "16.1.6",
"tailwindcss": "^4",
"typescript": "5.1.3"
}
}
7 changes: 7 additions & 0 deletions examples/with-passphrase-encrypt-export/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};

export default config;
1 change: 1 addition & 0 deletions examples/with-passphrase-encrypt-export/public/file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/with-passphrase-encrypt-export/public/globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/with-passphrase-encrypt-export/public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/with-passphrase-encrypt-export/public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/with-passphrase-encrypt-export/public/window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
33 changes: 33 additions & 0 deletions examples/with-passphrase-encrypt-export/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import "tailwindcss";

:root {
--background: #ffffff;
--foreground: #171717;
}

@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}

button {
padding: 0.5rem 1rem;
border: none;
border-radius: 4px;
cursor: pointer;
}
73 changes: 73 additions & 0 deletions examples/with-passphrase-encrypt-export/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"use client";

import "@turnkey/react-wallet-kit/styles.css";
import "./globals.css";
import { StamperType, TurnkeyProvider } from "@turnkey/react-wallet-kit";

interface RootLayoutProps {
children: React.ReactNode;
}

function RootLayout({ children }: RootLayoutProps) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<title>Export and Sign</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
</head>
<body>
<TurnkeyProvider
config={{
apiBaseUrl: process.env.NEXT_PUBLIC_BASE_URL!,
authProxyUrl: process.env.NEXT_PUBLIC_AUTH_PROXY_URL!,
exportIframeUrl: process.env.NEXT_PUBLIC_EXPORT_IFRAME_URL!,
authProxyConfigId: process.env.NEXT_PUBLIC_AUTH_PROXY_ID!,
organizationId: process.env.NEXT_PUBLIC_ORGANIZATION_ID!,
auth: {
methods: {
passkeyAuthEnabled: true,
emailOtpAuthEnabled: true,
walletAuthEnabled: true,
},
autoRefreshSession: true,
},
ui: {
darkMode: true,
},
walletConfig: {
features: {
auth: true,
connecting: true,
},
chains: {
ethereum: {
native: true,
walletConnectNamespaces: ["eip155:1"],
},
solana: {
native: true,
walletConnectNamespaces: [
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
],
},
},
walletConnect: {
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!,
appMetadata: {
name: "Turnkey Wallet",
description: "A wallet for Turnkey",
url: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_URL!,
icons: ["/favicon.svg"],
},
},
},
}}
>
{children}
</TurnkeyProvider>
</body>
</html>
);
}

export default RootLayout;
Loading
Loading