Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Commit

Permalink
example without nhost-js-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
elitan committed Jul 12, 2020
1 parent ff95ea6 commit 32922b1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,31 @@ function Dashboard(props) {

export default privateRoute(Dashboard);
```

# FAQ

## Is `nhost-js-sdk` required?

No. You can use `react-nhost` without `nhost-js-sdk`.

All requests will be sent without an `Authorization` header. This means you can only interact with data that is allowed using the role set as `HASURA_GRAPHQL_UNAUTHORIZED_ROLE`. (default to `public` at Nhost) [Learn more about public access](https://hasura.io/docs/1.0/graphql/manual/auth/authentication/unauthenticated-access.html).

Here's an example:

```jsx
import React from "react";
import ReactDOM from "react-dom";
import { NhostApolloProvider } from "react-nhost";
import App from "./App";

ReactDOM.render(
<React.StrictMode>
<NhostApolloProvider
gql_endpoint={`https://hasura-xxx.nhost.app/v1/graphql`}
>
<App />
</NhostApolloProvider>
</React.StrictMode>,
document.getElementById("root")
);
```

0 comments on commit 32922b1

Please sign in to comment.