Spotify.NET/assets/js/9008bace.1f22376b.js
2023-05-06 11:26:16 +00:00

1 line
4.8 KiB
JavaScript

"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[3924],{3905:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return d}});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),l=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},u=function(e){var t=l(e.components);return n.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,i=e.originalType,p=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),m=l(r),d=o,f=m["".concat(p,".").concat(d)]||m[d]||s[d]||i;return r?n.createElement(f,a(a({ref:t},u),{},{components:r})):n.createElement(f,a({ref:t},u))}));function d(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=r.length,a=new Array(i);a[0]=m;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:o,a[1]=c;for(var l=2;l<i;l++)a[l]=r[l];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}m.displayName="MDXCreateElement"},7761:function(e,t,r){r.r(t),r.d(t,{assets:function(){return s},contentTitle:function(){return l},default:function(){return f},frontMatter:function(){return p},metadata:function(){return u},toc:function(){return m}});var n=r(7462),o=r(3366),i=(r(7294),r(3905)),a=r(4996),c=["components"],p={id:"example_cli_custom_html",title:"CLI - Custom HTML"},l=void 0,u={unversionedId:"example_cli_custom_html",id:"example_cli_custom_html",title:"CLI - Custom HTML",description:"Description",source:"@site/docs/example_cli_custom_html.md",sourceDirName:".",slug:"/example_cli_custom_html",permalink:"/SpotifyAPI-NET/docs/example_cli_custom_html",draft:!1,editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_cli_custom_html.md",tags:[],version:"current",lastUpdatedBy:"dependabot[bot]",lastUpdatedAt:1683372295,formattedLastUpdatedAt:"May 6, 2023",frontMatter:{id:"example_cli_custom_html",title:"CLI - Custom HTML"},sidebar:"docs",previous:{title:"Blazor ServerSide",permalink:"/SpotifyAPI-NET/docs/example_blazor"},next:{title:"CLI - Persistent Config",permalink:"/SpotifyAPI-NET/docs/example_cli_persistent_config"}},s={},m=[{value:"Description",id:"description",level:2},{value:"Run it",id:"run-it",level:2}],d={toc:m};function f(e){var t=e.components,r=(0,o.Z)(e,c);return(0,i.kt)("wrapper",(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"description"},"Description"),(0,i.kt)("p",null,"An example to show how you can display your own HTML resource after the user went through the authentication process of either ",(0,i.kt)("a",{parentName:"p",href:"/SpotifyAPI-NET/docs/implicit_grant"},"Implicit Grant"),", ",(0,i.kt)("a",{parentName:"p",href:"/SpotifyAPI-NET/docs/authorization_code"},"Authorization Code")," or ",(0,i.kt)("a",{parentName:"p",href:"/SpotifyAPI-NET/docs/pkce"},"PKCE"),"."),(0,i.kt)("img",{alt:"CLI Custom HTML Example",src:(0,a.Z)("img/cli_custom_html.jpeg")}),(0,i.kt)("h2",{id:"run-it"},"Run it"),(0,i.kt)("p",null,"Before running it, make sure you created an app in your ",(0,i.kt)("a",{parentName:"p",href:"https://developer.spotify.com/dashboard/"},"spotify dashboard")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"https://localhost:5001")," is a redirect uri of it."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"# Assumes linux and current working directory is the cloned repository\ncd SpotifyAPI.Web.Examples/Example.CLI.CustomHTML\ndotnet restore\n\nSPOTIFY_CLIENT_ID=YourClientId SPOTIFY_CLIENT_SECRET=YourClientSecret dotnet run\n# A browser window should appear\n")))}f.isMDXComponent=!0}}]);