forked from stx-labs/stacks.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusersession.html
More file actions
1072 lines (1072 loc) · 62.5 KB
/
Copy pathusersession.html
File metadata and controls
1072 lines (1072 loc) · 62.5 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>UserSession | blockstack.js 19.3.0 Library Reference</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<link rel="stylesheet" href="../assets/css/custom-style.css">
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">blockstack.js 19.3.0 Library Reference</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="usersession.html">UserSession</a>
</li>
</ul>
<h1>Class UserSession</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Represents an instance of a signed in user for a particular app.</p>
</div>
<p>A signed in user has access to two major pieces of information
about the user, the user's private key for that app and the location
of the user's gaia storage bucket for the app.</p>
<p>A user can be signed in either directly through the interactive
sign in process or by directly providing the app private key.</p>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">UserSession</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="usersession.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="usersession.html#appconfig" class="tsd-kind-icon">app<wbr>Config</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="usersession.html#store" class="tsd-kind-icon">store</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#decryptcontent" class="tsd-kind-icon">decrypt<wbr>Content</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#deletefile" class="tsd-kind-icon">delete<wbr>File</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#encryptcontent" class="tsd-kind-icon">encrypt<wbr>Content</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#generateandstoretransitkey" class="tsd-kind-icon">generate<wbr>And<wbr>Store<wbr>Transit<wbr>Key</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#getauthresponsetoken" class="tsd-kind-icon">get<wbr>Auth<wbr>Response<wbr>Token</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#getfile" class="tsd-kind-icon">get<wbr>File</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#getfileurl" class="tsd-kind-icon">get<wbr>File<wbr>Url</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#getorsetlocalgaiahubconnection" class="tsd-kind-icon">get<wbr>OrSet<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#handlependingsignin" class="tsd-kind-icon">handle<wbr>Pending<wbr>Sign<wbr>In</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#issigninpending" class="tsd-kind-icon">is<wbr>Sign<wbr>InPending</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#isusersignedin" class="tsd-kind-icon">is<wbr>User<wbr>Signed<wbr>In</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#listfiles" class="tsd-kind-icon">list<wbr>Files</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#loaduserdata" class="tsd-kind-icon">load<wbr>User<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#makeauthrequest" class="tsd-kind-icon">make<wbr>Auth<wbr>Request</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#putfile" class="tsd-kind-icon">put<wbr>File</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#redirecttosignin" class="tsd-kind-icon">redirect<wbr>ToSign<wbr>In</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#redirecttosigninwithauthrequest" class="tsd-kind-icon">redirect<wbr>ToSign<wbr>InWith<wbr>Auth<wbr>Request</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="usersession.html#setlocalgaiahubconnection" class="tsd-kind-icon">set<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="usersession.html#signuserout" class="tsd-kind-icon">sign<wbr>User<wbr>Out</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>User<wbr>Session<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="usersession.html" class="tsd-signature-type">UserSession</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L42">auth/userSession.ts:42</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a UserSession object</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">object</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
</div>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> app<wbr>Config<span class="tsd-signature-symbol">?: </span><a href="appconfig.html" class="tsd-signature-type">AppConfig</a></h5>
</li>
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> session<wbr>Options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/sessionoptions.html" class="tsd-signature-type">SessionOptions</a></h5>
</li>
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> session<wbr>Store<span class="tsd-signature-symbol">?: </span><a href="sessiondatastore.html" class="tsd-signature-type">SessionDataStore</a></h5>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="usersession.html" class="tsd-signature-type">UserSession</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="appconfig" class="tsd-anchor"></a>
<h3>app<wbr>Config</h3>
<div class="tsd-signature tsd-kind-icon">app<wbr>Config<span class="tsd-signature-symbol">:</span> <a href="appconfig.html" class="tsd-signature-type">AppConfig</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L40">auth/userSession.ts:40</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="store" class="tsd-anchor"></a>
<h3>store</h3>
<div class="tsd-signature tsd-kind-icon">store<span class="tsd-signature-symbol">:</span> <a href="sessiondatastore.html" class="tsd-signature-type">SessionDataStore</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L42">auth/userSession.ts:42</a></li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="decryptcontent" class="tsd-anchor"></a>
<h3>decrypt<wbr>Content</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">decrypt<wbr>Content<span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L284">auth/userSession.ts:284</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Decrypts data encrypted with <code>encryptContent</code> with the
transit private key.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>encrypted content.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">object</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> private<wbr>Key<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The hex string of the ECDSA private
key to use for decryption. If not provided, will use user's appPrivateKey.</p>
</div>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">Buffer</span>
</h4>
<p>decrypted content.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="deletefile" class="tsd-anchor"></a>
<h3>delete<wbr>File</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">delete<wbr>File<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L345">auth/userSession.ts:345</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Deletes the specified file from the app's data store.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>path: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The path to the file to delete.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">object</span></h5>
<div class="tsd-comment tsd-typography">
<p>Optional options object.</p>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> was<wbr>Signed<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<p>Set to true if the file was originally signed
in order for the corresponding signature file to also be deleted.</p>
</div>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
<p>Resolves when the file has been removed or rejects with an error.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="encryptcontent" class="tsd-anchor"></a>
<h3>encrypt<wbr>Content</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">encrypt<wbr>Content<span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L269">auth/userSession.ts:269</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Encrypts the data provided with the app public key.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span></h5>
<div class="tsd-comment tsd-typography">
<p>the data to encrypt</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">object</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> public<wbr>Key<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>the hex string of the ECDSA public
key to use for encryption. If not provided, will use user's appPrivateKey.</p>
</div>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<p>Stringified ciphertext object</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="generateandstoretransitkey" class="tsd-anchor"></a>
<h3>generate<wbr>And<wbr>Store<wbr>Transit<wbr>Key</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">generate<wbr>And<wbr>Store<wbr>Transit<wbr>Key<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L189">auth/userSession.ts:189</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Generates a ECDSA keypair to
use as the ephemeral app transit private key
and store in the session.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<p>the hex encoded private key</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getauthresponsetoken" class="tsd-anchor"></a>
<h3>get<wbr>Auth<wbr>Response<wbr>Token</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Auth<wbr>Response<wbr>Token<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L202">auth/userSession.ts:202</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Retrieve the authentication token from the URL query.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<p>the authentication token if it exists otherwise <code>null</code></p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getfile" class="tsd-anchor"></a>
<h3>get<wbr>File</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>File<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/getfileoptions.html" class="tsd-signature-type">GetFileOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L310">auth/userSession.ts:310</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Retrieves the specified file from the app's data store.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>path: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>the path to the file to read</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/getfileoptions.html" class="tsd-signature-type">GetFileOptions</a></h5>
<div class="tsd-comment tsd-typography">
<p>a <a href="../interfaces/getfileoptions.html">GetFileOptions</a> object</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">></span></h4>
<p>that resolves to the raw data in the file
or rejects with an error</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getfileurl" class="tsd-anchor"></a>
<h3>get<wbr>File<wbr>Url</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>File<wbr>Url<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/getfileurloptions.html" class="tsd-signature-type">GetFileUrlOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L321">auth/userSession.ts:321</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get the URL for reading a file from an app's data store.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>path: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>the path to the file to read</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/getfileurloptions.html" class="tsd-signature-type">GetFileUrlOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
<p>that resolves to the URL or rejects with an error</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getorsetlocalgaiahubconnection" class="tsd-anchor"></a>
<h3>get<wbr>OrSet<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>OrSet<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/gaiahubconfig.html" class="tsd-signature-type">GaiaHubConfig</a><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L353">auth/userSession.ts:353</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p> @ignore</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/gaiahubconfig.html" class="tsd-signature-type">GaiaHubConfig</a><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="handlependingsignin" class="tsd-anchor"></a>
<h3>handle<wbr>Pending<wbr>Sign<wbr>In</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">handle<wbr>Pending<wbr>Sign<wbr>In<span class="tsd-signature-symbol">(</span>authResponseToken<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/userdata.html" class="tsd-signature-type">UserData</a><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L232">auth/userSession.ts:232</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Try to process any pending sign in request by returning a <code>Promise</code> that resolves
to the user data object if the sign in succeeds.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> authResponseToken: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = this.getAuthResponseToken()</span></h5>
<div class="tsd-comment tsd-typography">
<p>the signed authentication response token</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/userdata.html" class="tsd-signature-type">UserData</a><span class="tsd-signature-symbol">></span></h4>
<p>that resolves to the user data object if successful and rejects
if handling the sign in request fails or there was no pending sign in request.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="issigninpending" class="tsd-anchor"></a>
<h3>is<wbr>Sign<wbr>InPending</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>Sign<wbr>InPending<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L211">auth/userSession.ts:211</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Check if there is a authentication request that hasn't been handled.</p>
</div>
<dl class="tsd-comment-tags">
<dt>returns{boolean}</dt>
<dd><p><code>true</code> if there is a pending sign in, otherwise <code>false</code></p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isusersignedin" class="tsd-anchor"></a>
<h3>is<wbr>User<wbr>Signed<wbr>In</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>User<wbr>Signed<wbr>In<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L220">auth/userSession.ts:220</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Check if a user is currently signed in.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
<p><code>true</code> if the user is signed in, <code>false</code> if not.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="listfiles" class="tsd-anchor"></a>
<h3>list<wbr>Files</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">list<wbr>Files<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L333">auth/userSession.ts:333</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>List the set of files in this application's Gaia storage bucket.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>callback: <span class="tsd-signature-type">function</span></h5>
<div class="tsd-comment tsd-typography">
<p>a callback to invoke on each named file that
returns <code>true</code> to continue the listing operation or <code>false</code> to end it</p>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>name: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
<p>that resolves to the number of files listed</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="loaduserdata" class="tsd-anchor"></a>
<h3>load<wbr>User<wbr>Data</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">load<wbr>User<wbr>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/userdata.html" class="tsd-signature-type">UserData</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L243">auth/userSession.ts:243</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Retrieves the user data object. The user's profile is stored in the key <a href="profile.html">Profile</a>.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/userdata.html" class="tsd-signature-type">UserData</a></h4>
<p>User data object.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="makeauthrequest" class="tsd-anchor"></a>
<h3>make<wbr>Auth<wbr>Request</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">make<wbr>Auth<wbr>Request<span class="tsd-signature-symbol">(</span>transitKey<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, redirectURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, manifestURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, scopes<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><a href="../enums/authscope.html" class="tsd-signature-type">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span>, appDomain<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, expiresAt<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, extraParams<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L158">auth/userSession.ts:158</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Generates an authentication request that can be sent to the Blockstack
browser for the user to approve sign in. This authentication request can
then be used for sign in by passing it to the <a href="usersession.html#redirecttosigninwithauthrequest">redirectToSignInWithAuthRequest</a>
method.</p>
</div>
<p><em>Note</em>: This method should only be used if you want to use a customized authentication
flow. Typically, you'd use <a href="usersession.html#redirecttosignin">redirectToSignIn</a> which is the default sign in method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> transitKey: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>A HEX encoded transit private key.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> redirectURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Location to redirect the user to after sign in approval.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> manifestURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Location of this app's manifest file.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> scopes: <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><a href="../enums/authscope.html" class="tsd-signature-type">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h5>
<div class="tsd-comment tsd-typography">
<p>The permissions this app is requesting. The default is <code>store_write</code>.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> appDomain: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The origin of the app.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> expiresAt: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = nextHour().getTime()</span></h5>
<div class="tsd-comment tsd-typography">
<p>The time at which this request is no longer valid.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> extraParams: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5>
<div class="tsd-comment tsd-typography">
<p>Any extra parameters to pass to the authenticator. Use this to
pass options that aren't part of the Blockstack authentication specification,
but might be supported by special authenticators.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<p>the authentication request</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="putfile" class="tsd-anchor"></a>
<h3>put<wbr>File</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">put<wbr>File<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/putfileoptions.html" class="tsd-signature-type">PutFileOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L297">auth/userSession.ts:297</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Stores the data provided in the app's data store to to the file specified.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>path: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>the path to store the data in</p>
</div>
</li>
<li>
<h5>content: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span></h5>
<div class="tsd-comment tsd-typography">
<p>the data to store in the file</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/putfileoptions.html" class="tsd-signature-type">PutFileOptions</a></h5>
<div class="tsd-comment tsd-typography">
<p>a <a href="../interfaces/putfileoptions.html">PutFileOptions</a> object</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
<p>that resolves if the operation succeed and rejects
if it failed</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="redirecttosignin" class="tsd-anchor"></a>
<h3>redirect<wbr>ToSign<wbr>In</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">redirect<wbr>ToSign<wbr>In<span class="tsd-signature-symbol">(</span>redirectURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, manifestURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, scopes<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><a href="../enums/authscope.html" class="tsd-signature-type">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L104">auth/userSession.ts:104</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Generates an authentication request and redirects the user to the Blockstack
browser to approve the sign in request.</p>
</div>
<p>Please note that this requires that the web browser properly handles the
<code>blockstack:</code> URL protocol handler.</p>
<p>Most applications should use this
method for sign in unless they require more fine grained control over how the
authentication request is generated. If your app falls into this category,
use <a href="usersession.html#generateandstoretransitkey">generateAndStoreTransitKey</a>, <a href="usersession.html#makeauthrequest">makeAuthRequest</a>,
and <a href="usersession.html#redirecttosigninwithauthrequest">redirectToSignInWithAuthRequest</a> to build your own sign in process.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> redirectURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Location of your application.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> manifestURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Location of the manifest.json file</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> scopes: <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><a href="../enums/authscope.html" class="tsd-signature-type">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h5>
<div class="tsd-comment tsd-typography">
<p>Permissions requested by the application. Possible values are
<code>store_write</code> (default) or <code>publish_data</code>.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="redirecttosigninwithauthrequest" class="tsd-anchor"></a>
<h3>redirect<wbr>ToSign<wbr>InWith<wbr>Auth<wbr>Request</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">redirect<wbr>ToSign<wbr>InWith<wbr>Auth<wbr>Request<span class="tsd-signature-symbol">(</span>authRequest<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, blockstackIDHost<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L127">auth/userSession.ts:127</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Redirects the user to the Blockstack browser to approve the sign in request.
To construct a request see the <a href="usersession.html#makeauthrequest">makeAuthRequest</a> function.</p>
</div>
<p>The user is redirected to the authenticator URL specified in the <code>AppConfig</code>
if the <code>blockstack:</code> protocol handler is not detected.
Please note that the protocol handler detection does not work on all browsers.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> authRequest: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>A request string built by the <a href="usersession.html#makeauthrequest">makeAuthRequest</a> function</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> blockstackIDHost: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The ID of the Blockstack Browser application.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a name="setlocalgaiahubconnection" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> set<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
<li class="tsd-signature tsd-kind-icon">set<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/gaiahubconfig.html" class="tsd-signature-type">GaiaHubConfig</a><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L373">auth/userSession.ts:373</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>These two functions are app-specific connections to gaia hub,
they read the user data object for information on setting up
a hub connection, and store the hub config to localstorage</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/gaiahubconfig.html" class="tsd-signature-type">GaiaHubConfig</a><span class="tsd-signature-symbol">></span></h4>
<p>that resolves to the new gaia hub connection</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="signuserout" class="tsd-anchor"></a>
<h3>sign<wbr>User<wbr>Out</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">sign<wbr>User<wbr>Out<span class="tsd-signature-symbol">(</span>redirectURL<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/auth/userSession.ts#L257">auth/userSession.ts:257</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sign the user out and optionally redirect to given location.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> redirectURL: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Location to redirect user to after sign out.
Only used in environments with <code>window</code> available</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="usersession.html" class="tsd-kind-icon">User<wbr>Session</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="usersession.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="usersession.html#appconfig" class="tsd-kind-icon">app<wbr>Config</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="usersession.html#store" class="tsd-kind-icon">store</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#decryptcontent" class="tsd-kind-icon">decrypt<wbr>Content</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#deletefile" class="tsd-kind-icon">delete<wbr>File</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#encryptcontent" class="tsd-kind-icon">encrypt<wbr>Content</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#generateandstoretransitkey" class="tsd-kind-icon">generate<wbr>And<wbr>Store<wbr>Transit<wbr>Key</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#getauthresponsetoken" class="tsd-kind-icon">get<wbr>Auth<wbr>Response<wbr>Token</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#getfile" class="tsd-kind-icon">get<wbr>File</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#getfileurl" class="tsd-kind-icon">get<wbr>File<wbr>Url</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#getorsetlocalgaiahubconnection" class="tsd-kind-icon">get<wbr>OrSet<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#handlependingsignin" class="tsd-kind-icon">handle<wbr>Pending<wbr>Sign<wbr>In</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#issigninpending" class="tsd-kind-icon">is<wbr>Sign<wbr>InPending</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#isusersignedin" class="tsd-kind-icon">is<wbr>User<wbr>Signed<wbr>In</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#listfiles" class="tsd-kind-icon">list<wbr>Files</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#loaduserdata" class="tsd-kind-icon">load<wbr>User<wbr>Data</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#makeauthrequest" class="tsd-kind-icon">make<wbr>Auth<wbr>Request</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#putfile" class="tsd-kind-icon">put<wbr>File</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#redirecttosignin" class="tsd-kind-icon">redirect<wbr>ToSign<wbr>In</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#redirecttosigninwithauthrequest" class="tsd-kind-icon">redirect<wbr>ToSign<wbr>InWith<wbr>Auth<wbr>Request</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a href="usersession.html#setlocalgaiahubconnection" class="tsd-kind-icon">set<wbr>Local<wbr>Gaia<wbr>Hub<wbr>Connection</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="usersession.html#signuserout" class="tsd-kind-icon">sign<wbr>User<wbr>Out</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">