balena-register-device
TypeScript icon, indicating that this package has built-in type declarations

9.0.2 • Public • Published
��b a l e n a - r e g i s t e r - d e v i c e = = = = = = = = = = = = = = = = = = = = = > B a l e n a d e v i c e r e g i s t r a t i o n u t i l i t i e s . [ ! [ n p m v e r s i o n ] ( h t t p s : / / b a d g e . f u r y . i o / j s / b a l e n a - r e g i s t e r - d e v i c e . s v g ) ] ( h t t p : / / b a d g e . f u r y . i o / j s / b a l e n a - r e g i s t e r - d e v i c e ) [ ! [ d e p e n d e n c i e s ] ( h t t p s : / / d a v i d - d m . o r g / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e . s v g ) ] ( h t t p s : / / d a v i d - d m . o r g / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e . s v g ) [ ! [ B u i l d S t a t u s ] ( h t t p s : / / t r a v i s - c i . o r g / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e . s v g ? b r a n c h = m a s t e r ) ] ( h t t p s : / / t r a v i s - c i . o r g / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e ) [ ! [ B u i l d s t a t u s ] ( h t t p s : / / c i . a p p v e y o r . c o m / a p i / p r o j e c t s / s t a t u s / u h 8 b g 4 5 p x x y x 2 q i f / b r a n c h / m a s t e r ? s v g = t r u e ) ] ( h t t p s : / / c i . a p p v e y o r . c o m / p r o j e c t / r e s i n - i o / b a l e n a - r e g i s t e r - d e v i c e / b r a n c h / m a s t e r ) I n s t a l l a t i o n - - - - - - - - - - - - I n s t a l l ` b a l e n a - r e g i s t e r - d e v i c e ` b y r u n n i n g : ` ` ` s h $ n p m i n s t a l l - - s a v e b a l e n a - r e g i s t e r - d e v i c e ` ` ` D o c u m e n t a t i o n - - - - - - - - - - - - - B a l e n a - R e g i s t e r - D e v i c e e x p o r t s a f a c t o r y f u n c t i o n , w h i c h m u s t b e c a l l e d w i t h a d e p e n d e n c i e s o b j e c t , c o n t a i n i n g a c o n f i g u r e d [ ` b a l e n a - r e q u e s t ` ] ( h t t p s : / / g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e q u e s t ) i n s t a n c e . E x a m p l e : ` ` ` c o f f e e d e v i c e R e g i s t e r = r e q u i r e ( ' b a l e n a - r e g i s t e r - d e v i c e ' ) ( { r e q u e s t : r e q u e s t # A n i n s t a n t i a t e d b a l e n a - r e q u e s t i n s t a n c e } ) ` ` ` # # # d e v i c e R e g i s t e r . g e n e r a t e U n i q u e K e y ( ) G e n e r a t e a r a n d o m k e y , u s e f u l f o r b o t h u u i d a n d a p i k e y . E x a m p l e : ` ` ` c o f f e e r a n d o m K e y = d e v i c e R e g i s t e r . g e n e r a t e U n i q u e K e y ( ) # r a n d o m K e y i s a r a n d o m l y g e n e r a t e d k e y t h a t c a n b e u s e d a s e i t h e r a u u i d o r a n a p i k e y c o n s o l e . l o g ( r a n d o m K e y ) ` ` ` # # # d e v i c e R e g i s t e r . r e g i s t e r ( O b j e c t o p t i o n s , F u n c t i o n c a l l b a c k ) R e g i s t e r a d e v i c e w i t h B a l e n a . * * N o t i c e * * : Y o u c a n u s e t h i s f u n c t i o n a s a p r o m i s e i f y o u o m i t t h e ` c a l l b a c k ` a r g u m e n t . T h e ` o p t i o n s ` o b j e c t r e q u i r e s t h e f o l l o w i n g p r o p e r t i e s : - ` N u m b e r u s e r I d ` : T h e u s e r i d - o p t i o n a l . - ` N u m b e r a p p l i c a t i o n I d ` : T h e a p p l i c a t i o n i d . - ` S t r i n g u u i d ` : T h e d e v i c e ' s U U I D . - ` S t r i n g d e v i c e T y p e ` : T h e d e v i c e t y p e s l u g . - ` S t r i n g d e v i c e A p i K e y ` : T h e A P I k e y t o c r e a t e f o r t h e n e w l y r e g i s t e r e d d e v i c e . - ` S t r i n g p r o v i s i o n i n g A p i K e y ` : T h e p r o v i s i o n i n g A P I K e y . - ` S t r i n g a p i E n d p o i n t ` : T h e A P I e n d p o i n t . T h e ` c a l l b a c k ` g e t s c a l l e d w i t h t w o a r g u m e n t s : ` ( e r r o r , d e v i c e I n f o ) ` , w h e r e ` d e v i c e I n f o ` i s a n o b j e c t c o n t a i n i n g o n e p r o p e r t y : t h e ` i d ` f o r t h e d e v i c e t h a t w a s j u s t r e g i s t e r e d . E x a m p l e : ` ` ` c o f f e e d e v i c e R e g i s t e r . r e g i s t e r u s e r I d : 1 9 9 a p p l i c a t i o n I d : 1 0 3 5 0 u u i d : ' . . . ' d e v i c e T y p e : ' r a s p b e r r y - p i ' d e v i c e A p i K e y : ' . . . ' p r o v i s i o n i n g A p i K e y : ' . . . ' a p i E n d p o i n t : ' h t t p s : / / a p i . b a l e n a - c l o u d . c o m ' , ( e r r o r , d e v i c e I n f o ) - > t h r o w e r r o r i f e r r o r ? c o n s o l e . l o g ( d e v i c e I n f o ) # { i d } ` ` ` T e s t s - - - - - R u n t h e t e s t s u i t e b y d o i n g : ` ` ` s h $ n p m t e s t ` ` ` C o n t r i b u t e - - - - - - - - - - - I s s u e T r a c k e r : [ g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e / i s s u e s ] ( h t t p s : / / g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e / i s s u e s ) - S o u r c e C o d e : [ g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e ] ( h t t p s : / / g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e ) B e f o r e s u b m i t t i n g a P R , p l e a s e m a k e s u r e t h a t y o u i n c l u d e t e s t s , a n d t h a t [ c o f f e e l i n t ] ( h t t p : / / w w w . c o f f e e l i n t . o r g / ) r u n s w i t h o u t a n y w a r n i n g : ` ` ` s h $ n p m r u n l i n t ` ` ` S u p p o r t - - - - - - - I f y o u ' r e h a v i n g a n y p r o b l e m , p l e a s e [ r a i s e a n i s s u e ] ( h t t p s : / / g i t h u b . c o m / b a l e n a - i o - m o d u l e s / b a l e n a - r e g i s t e r - d e v i c e / i s s u e s / n e w ) o n G i t H u b . L i c e n s e - - - - - - - T h e p r o j e c t i s l i c e n s e d u n d e r t h e A p a c h e 2 . 0 l i c e n s e .

Package Sidebar

Install

npm i balena-register-device

Weekly Downloads

6,546

Version

9.0.2

License

Apache-2.0

Unpacked Size

26.2 kB

Total Files

5

Last publish

Collaborators

  • balena.io