Skip to content

Commit

Permalink
SDK sidebar PoC
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandratran committed Jul 17, 2024
1 parent 83276d0 commit ce46fba
Show file tree
Hide file tree
Showing 61 changed files with 246 additions and 194 deletions.
19 changes: 19 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ const config = {
},
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "sdk",
path: "sdk",
routeBasePath: "sdk",
editUrl: "https://github.com/MetaMask/metamask-docs/edit/main/",
sidebarPath: require.resolve("./sdk-sidebar.js"),
breadcrumbs: false,
},
],
[
"@docusaurus/plugin-content-docs",
{
Expand Down Expand Up @@ -172,6 +183,10 @@ const config = {
width: 150,
},
items: [
{
to: "sdk",
label: "SDK",
},
{
to: "wallet",
label: "Wallet",
Expand Down Expand Up @@ -229,6 +244,10 @@ const config = {
{
title: "Documentation",
items: [
{
label: "SDK",
to: "/sdk",
},
{
label: "Wallet",
to: "/wallet",
Expand Down
58 changes: 58 additions & 0 deletions sdk-sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebar = {
// By default, Docusaurus generates a sidebar from the docs folder structure
// snapsSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
sdkSidebar: [
"index",
{
type: "category",
label: "Get started",
link: { type: "generated-index", slug: "/get-started" },
collapsed: false,
items: [{ type: "autogenerated", dirName: "get-started" }],
},
{
type: "category",
label: "How to",
link: { type: "generated-index", slug: "/how-to" },
collapsed: false,
items: [{ type: "autogenerated", dirName: "how-to" }],
},
{
type: "category",
label: "Concepts",
link: { type: "generated-index", slug: "/concepts" },
collapsed: false,
items: [{ type: "autogenerated", dirName: "concepts" }],
},
{
type: "category",
label: "Tutorials",
link: { type: "generated-index", slug: "/tutorials" },
collapsed: false,
items: [{ type: "autogenerated", dirName: "tutorials" }],
},
{
type: "category",
label: "Reference",
link: { type: "generated-index", slug: "/reference" },
collapsed: false,
items: [{ type: "autogenerated", dirName: "reference" }],
},
],
};

module.exports = sidebar;
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
7 changes: 1 addition & 6 deletions wallet/concepts/sdk/index.md → sdk/concepts/about-sdk.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
description: Learn about MetaMask SDK.
sidebar_position: 3
tags:
- JavaScript SDK
- iOS SDK
- Android SDK
- Unity SDK
sidebar_position: 1
---

import Tabs from "@theme/Tabs";
Expand Down
8 changes: 3 additions & 5 deletions wallet/concepts/sdk/android.md → sdk/concepts/android.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
sidebar_position: 2
sidebar_position: 3
description: Learn about the Android SDK architecture.
tags:
- Android SDK
---

# Android SDK architecture
Expand All @@ -23,7 +21,7 @@ the Android SDK differs from the other SDK platforms.

The following diagram outlines the high-level architecture of the Android SDK:

![Android SDK architecture diagram](../../assets/sdk-android-architecture.png)
![Android SDK architecture diagram](../assets/sdk-android-architecture.png)

The MetaMask Android SDK consists of two components:

Expand All @@ -48,7 +46,7 @@ in Kotlin) using different mechanisms depending on the direction of communicatio

The following diagram outlines the communication flow between the Android client SDK and server SDK:

![Android SDK communication diagram](../../assets/sdk-android-communication.png)
![Android SDK communication diagram](../assets/sdk-android-communication.png)

The flow is as follows:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
sidebar_position: 1
sidebar_position: 2
sidebar_label: SDK connections
description: Learn about how a dapp with the SDK installed connects to MetaMask.
tags:
- JavaScript SDK
- iOS SDK
- Android SDK
- Unity SDK
---

# MetaMask SDK connections
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
sidebar_label: Third-party libraries
sidebar_position: 4
sidebar_position: 1
description: Set up the SDK using third-party libraries.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with third-party libraries

Use [MetaMask SDK](../../../concepts/sdk/index.md) with the following third-party libraries:
Use [MetaMask SDK](../../concepts/about-sdk.md) with the following third-party libraries:

- [Web3-Onboard](web3-onboard.md)
- [Wagmi](wagmi.md)
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
description: Integrate MetaMask SDK with Wagmi in your JavaScript dapp.
sidebar_position: 2
sidebar_position: 1
sidebar_label: Wagmi
tags:
- JavaScript SDK
---

# Use Wagmi with MetaMask SDK
Expand Down Expand Up @@ -118,7 +116,7 @@ Mobile dapps can lose their continuous connection with MetaMask, causing read-on

These are some errors that might occur in mobile environments:

![Wagmi errors](../../../assets/wagmi-errors.png)
![Wagmi errors](../../assets/wagmi-errors.png)

To overcome this limitation in mobile dapps that rely on a continuous connection with MetaMask,
use the Infura API to make read-only requests.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
description: Integrate MetaMask SDK with Web3-Onboard in your JavaScript dapp.
sidebar_position: 1
sidebar_position: 2
sidebar_label: Web3-Onboard
tags:
- JavaScript SDK
---

# Use Web3-Onboard with MetaMask SDK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
sidebar_label: Gaming
sidebar_position: 2
sidebar_position: 4
description: Set up the SDK in your gaming dapp.
tags:
- Unity SDK
---

# Use MetaMask SDK with gaming dapps

Import [MetaMask SDK](../../../concepts/sdk/index.md) into your gaming dapp to enable your users
Import [MetaMask SDK](../../concepts/about-sdk.md) into your gaming dapp to enable your users
to easily connect with their MetaMask Mobile wallet.
See the instructions for the following gaming platforms:

- [Unity](unity/index.md)
- [Unreal Engine](unreal-engine.md) (coming soon)
- [Unity](unity.md)
- Unreal Engine (coming soon)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: Unity
sidebar_position: 1
description: Set up the SDK in your Unity game.
tags:
- Unity SDK
---

import YoutubeEmbed from '@site/src/components/YoutubeEmbed';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: Electron
sidebar_position: 6
description: Set up the SDK in your Electron dapp.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with Electron
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
sidebar_label: JavaScript
sidebar_position: 1
sidebar_position: 2
description: Set up the SDK in your JavaScript dapp.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with JavaScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: Node.js
sidebar_position: 5
description: Set up the SDK in your Node.js dapp.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with Node.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: Other web frameworks
sidebar_position: 3
description: Set up the SDK in other web frameworks.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with other web frameworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: Pure JavaScript
sidebar_position: 2
description: Set up the SDK in your Pure JavaScript dapp.
tags:
- JavaScript SDK
---

# Use MetaMask SDK with pure JavaScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: React Native and Expo
sidebar_position: 4
description: Set up the SDK in your React Native dapp.
tags:
- JavaScript SDK
---

import Tabs from "@theme/Tabs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: React
sidebar_position: 1
description: Set up the SDK in your React dapp.
tags:
- JavaScript SDK
---

import Tabs from "@theme/Tabs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_label: React UI
sidebar_position: 1
description: Set up the SDK in your React dapp using the React UI package.
tags:
- JavaScript SDK
---

import Tabs from "@theme/Tabs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ sidebar_label: Android
sidebar_position: 2
toc_max_heading_level: 4
description: Set up the SDK in your Android dapp.
tags:
- Android SDK
---

# Use MetaMask SDK with Android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
sidebar_label: Mobile
sidebar_position: 3
description: Set up the SDK in your mobile dapp.
tags:
- iOS SDK
- Android SDK
---

# Use MetaMask SDK with mobile dapps

Import [MetaMask SDK](../../../concepts/sdk/index.md) into your mobile dapp to enable your users
Import [MetaMask SDK](../../concepts/about-sdk.md) into your mobile dapp to enable your users
to easily connect with their MetaMask Mobile wallet.
See the instructions for the following mobile platforms:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ sidebar_label: iOS
sidebar_position: 1
toc_max_heading_level: 4
description: Set up the SDK in your iOS dapp.
tags:
- iOS SDK
---

import Tabs from "@theme/Tabs";
Expand Down
8 changes: 8 additions & 0 deletions sdk/how-to/gaming/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Gaming",
"position": 3,
"link": {
"type": "generated-index",
"slug": "how-to/gaming"
}
}
8 changes: 8 additions & 0 deletions sdk/how-to/gaming/unity/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Unity",
"position": 1,
"link": {
"type": "generated-index",
"slug": "how-to/gaming/unity"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
sidebar_position: 1
sidebar_label: Connect and sign
tags:
- Unity SDK
---

# Connect and sign in Unity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_position: 4
sidebar_label: Enable human-readable addresses
description: Integrate Decentraweb into your Unity game to enable human-readable addresses.
tags:
- Unity SDK
---

import Tabs from "@theme/Tabs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
description: Set up MetaMask SDK with Infura in your Unity game.
sidebar_position: 2
sidebar_label: Set up Infura
tags:
- Unity SDK
---

# Set up Infura in Unity
Expand Down Expand Up @@ -47,7 +45,7 @@ your Unity game.

<p align="center">

![MetaMask Unity script](../../../../assets/unity-infura.png)
![MetaMask Unity script](../../../assets/unity-infura.png)

</p>

Expand Down
Loading

0 comments on commit ce46fba

Please sign in to comment.