File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ const netlifyIdentity = require("netlify-identity-widget");
95
95
96
96
netlifyIdentity .init ({
97
97
container: " #netlify-modal" // defaults to document.body,
98
- APIUrl: " https://some-identity-instance.example.com" // Set an absolute URL for the identity endpoint
99
98
});
100
99
101
100
netlifyIdentity .open (); // open the modal
@@ -121,6 +120,23 @@ netlifyIdentity.logout();
121
120
netlifyIdentity .gotrue ;
122
121
```
123
122
123
+ #### ` netlifyIdentity.init([opts]) `
124
+
125
+ You can pass an optional ` opts ` object to configure the widget when using the
126
+ module api. Options include:
127
+
128
+ ``` js
129
+ {
130
+ container: " #some-query-selector" ; // container to attach to
131
+ APIUrl: " https://www.example.com/.netlify/functions/identity" ; // Absolute url to endpoint. ONLY USE IN SPECIAL CASES!
132
+ }
133
+ ```
134
+
135
+ Generally avoid setting the ` APIUrl ` . You should only set this when your app is
136
+ served from a domain that differs from where the identity endpoint is served.
137
+ This is common for Cordova or Electron apps where you host from localhost or a
138
+ file.
139
+
124
140
## Localhost
125
141
126
142
When using the widget on localhost, it will prompt for your Netlify SiteURL the
You can’t perform that action at this time.
0 commit comments