mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 06:36:26 +00:00
Update documentation
This commit is contained in:
parent
1876a10b26
commit
7acffd96ba
7
SpotifyAPI.Docs/.vscode/settings.json
vendored
Normal file
7
SpotifyAPI.Docs/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"[javascript]": {
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": false
|
||||
}
|
||||
}
|
||||
}
|
@ -2,3 +2,24 @@
|
||||
id: example_cli_custom_html
|
||||
title: CLI - Custom HTML
|
||||
---
|
||||
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
|
||||
## Description
|
||||
|
||||
An example to show how you can display your own HTML resource after the user went through the authentication process of either [Implicit Grant](implicit_grant.md), [Authorization Code](authorization_code.md) or [PKCE](pkce.md).
|
||||
|
||||
<img alt="CLI Custom HTML Example" src={useBaseUrl('img/cli_custom_html.jpeg')} />
|
||||
|
||||
## Run it
|
||||
|
||||
Before running it, make sure you created an app in your [spotify dashboard](https://developer.spotify.com/dashboard/) and `https://localhost:5001` is a redirect uri of it.
|
||||
|
||||
```bash
|
||||
# Assumes linux and current working directory is the cloned repository
|
||||
cd SpotifyAPI.Web.Examples/Example.CLI.CustomHTML
|
||||
dotnet restore
|
||||
|
||||
SPOTIFY_CLIENT_ID=YourClientId SPOTIFY_CLIENT_SECRET=YourClientSecret dotnet run
|
||||
# A browser window should appear
|
||||
```
|
||||
|
@ -2,3 +2,25 @@
|
||||
id: example_cli_persistent_config
|
||||
title: CLI - Persistent Config
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
An example to show how an obtained access and refresh token can be stored persistently and re-used across application restarts. This results in fewer requests to spotifys authentication endpoints and a faster experience for the user. The example uses [PKCE](pkce.md) in combination with the `PKCEAuthenticator`, which automatically refreshes expired tokens.
|
||||
|
||||
The access and refresh token is saved in a `credentials.json` file of the current working directory.
|
||||
|
||||
## Run it
|
||||
|
||||
Before running it, make sure you created an app in your [spotify dashboard](https://developer.spotify.com/dashboard/) and `https://localhost:5000` is a redirect uri of it.
|
||||
|
||||
```bash
|
||||
# Assumes linux and current working directory is the cloned repository
|
||||
cd SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig
|
||||
dotnet restore
|
||||
|
||||
SPOTIFY_CLIENT_ID=YourClientId dotnet run
|
||||
# A browser window should appear
|
||||
# Restarting the process should NOT open a new authentication window
|
||||
# Instead, the local `crendentials.json` file is used
|
||||
SPOTIFY_CLIENT_ID=YourClientId dotnet run
|
||||
```
|
||||
|
@ -3,8 +3,7 @@ import TabItem from '@theme/TabItem';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import React from 'react';
|
||||
|
||||
// Will be removed after beta releases
|
||||
const VERSION = '6.0.0';
|
||||
const VERSION = '6.2.2';
|
||||
|
||||
const installCodeNuget = `Install-Package SpotifyAPI.Web
|
||||
# Optional Auth module, which includes an embedded HTTP Server for OAuth2
|
||||
@ -33,17 +32,17 @@ const InstallInstructions = () => {
|
||||
]}
|
||||
>
|
||||
<TabItem value="cli">
|
||||
<CodeBlock metastring="shell" className="shell">
|
||||
<CodeBlock language="shell" className="shell">
|
||||
{installCodeCLI}
|
||||
</CodeBlock>
|
||||
</TabItem>
|
||||
<TabItem value="nuget">
|
||||
<CodeBlock metastring="shell" className="shell">
|
||||
<CodeBlock language="shell" className="shell">
|
||||
{installCodeNuget}
|
||||
</CodeBlock>
|
||||
</TabItem>
|
||||
<TabItem value="reference">
|
||||
<CodeBlock metastring="xml" className="xml">
|
||||
<CodeBlock language="xml" className="xml">
|
||||
{installReference}
|
||||
</CodeBlock>
|
||||
</TabItem>
|
||||
|
@ -3,8 +3,6 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import Layout from '@theme/Layout';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import GitHubButton from 'react-github-btn';
|
||||
@ -131,7 +129,7 @@ function Home() {
|
||||
</div>
|
||||
</div>
|
||||
<div className={classnames('col col--7', styles.exampleCode)}>
|
||||
<CodeBlock metastring="csharp" className="csharp">
|
||||
<CodeBlock language="csharp" className="csharp">
|
||||
{exampleCode}
|
||||
</CodeBlock>
|
||||
</div>
|
||||
|
BIN
SpotifyAPI.Docs/static/img/cli_custom_html.jpeg
Normal file
BIN
SpotifyAPI.Docs/static/img/cli_custom_html.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
File diff suppressed because it is too large
Load Diff
26
SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig/.vscode/launch.json
vendored
Normal file
26
SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/net6.0/Example.CLI.PersistentConfig.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
41
SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig/.vscode/tasks.json
vendored
Normal file
41
SpotifyAPI.Web.Examples/Example.CLI.PersistentConfig/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/Example.CLI.PersistentConfig.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Example.CLI.PersistentConfig.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/Example.CLI.PersistentConfig.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user