-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
139 lines (123 loc) · 3.51 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="icon"
type="image/png"
href="https://www.skedify.me/favicon.svg"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<head>
<style>
@import url('https://fonts.googleapis.com/css?family=Fira+Sans');
div.wrapper {
line-height: 1.5;
font-family: 'Fira Sans', sans-serif !important;
}
h1 {
color: #324983;
}
a {
color: #324983;
}
</style>
</head>
<title>Skedify SDK</title>
</head>
<body style="margin: 2rem">
<div class="wrapper">
<h1>Documentation</h1>
<pre>Open devtools, so that you can play with `SDK`.</pre>
<h2>Snippet</h2>
<p>Use the following snippet to easily test the SDK:</p>
<ul>
<li>
<a
href="https://developer.chrome.com/docs/devtools/javascript/snippets/"
target="_blank"
>Chrome snippets</a
>
</li>
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Tools/Web_Console/The_command_line_interpreter"
target="_blank"
>Firefox JavaScript Interpreter</a
>
</li>
</ul>
</div>
<pre>
(function() {
const client_id = ''
const realm = 'https://api.skedify.com/enterprises/development'
const username = ''
const password = ''
const enterprise_id = '1'
const locale = 'nl'
console.clear();
const SDK = new Skedify.API({
auth_provider: Skedify.API.createAuthProviderString('public_client_password', {
client_id,
username,
password,
enterprise_id,
realm
}),
locale: locale,
logger: {
trace() {
console.log('trace');
},
info(data) {
console.log('info', data);
},
warn() {
console.log('warn');
},
debug() {
console.log('debug');
},
error() {
console.log('error');
},
fatal() {
console.log('fatal');
}
}
})
window.SDK = SDK
console.log('window.SDK is available!')
})();
</pre>
<div class="wrapper">
<code>Example: SDK.appointments(2).then(console.log)</code>
</div>
<script src="./lib/skedify-sdk.js"></script>
<script>
const onDOMContentLoaded = () => {
window.document.removeEventListener(
'DOMContentLoaded',
onDOMContentLoaded
)
const livereload = document.createElement('script')
livereload.src = `http://${
(location.host || 'localhost').split(':')[0]
}:35729/livereload.js?snipver=1`
document.head.appendChild(livereload)
}
window.document.addEventListener('DOMContentLoaded', onDOMContentLoaded)
</script>
<script>
window.SDK = new Skedify.API({
locale: 'nl-BE',
auth_provider: Skedify.API.createAuthProviderString('public_client', {
client_id: 'client id goes here',
realm: 'https://api.example.com',
}),
})
</script>
</body>
</html>