Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: minor updates, prettify #18

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn install
- name: prettier
run: yarn prettier:check
- name: Test build website
run: yarn build
deploy:
Expand Down
2 changes: 1 addition & 1 deletion docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Three steps are needed to access the sponsor package, which is hosted on [GitHub

2. [Obtain here](https://github.com/settings/tokens) a Personal Access Token with `packages:read` permission.

3. Set up your package manager so that it fetches the package from the GH packages registry. In this example, we're using an `NPM_TOKEN_GOOGLE_SIGN_IN` environment variable.
3. Set up your package manager so that it fetches the package from the GH packages registry instead of the public registry. In this example, we're using an `NPM_TOKEN_GOOGLE_SIGN_IN` environment variable.

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
Expand Down
1 change: 1 addition & 0 deletions docs/integration-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
sidebar_position: 51
---

# Integration Notes

Calling the methods exposed by this package may involve remote network calls and you should thus take into account that such calls may take a long time to complete (e.g. in case of poor network connection).
Expand Down
6 changes: 3 additions & 3 deletions docs/one-tap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ signature: (`params`: [`OneTapSignInParams`](api#onetapsigninparams)) => `Promis
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Android | Starts a flow to sign in with your app for the first time (to create a user account). It offers a list of user accounts to choose from (multiple Google accounts can be logged in on the device). |
| Apple | Starts an interactive sign-in flow. [Docs](https://developers.google.com/identity/sign-in/ios/reference/Classes/GIDSignIn#-signinwithpresentingviewcontroller:hint:completion:). It offers a list of user accounts to choose from (multiple Google accounts can be logged in on the device). |
| Web | Presents a one-tap prompt and waits for user interaction. Has slightly different styling than `signIn` prompt. [Read below](#web-support) for web support. |
| Web | Presents a one-tap prompt and waits for user interaction. Has slightly different styling than `signIn` prompt (configrable via the `context` param). [Read below](#web-support) for web support. |

You don't need to call `createAccount` as a response to a user action - you can call it some time after your app starts (Though keep in mind the way the dialog is presented on iOS might be inconvenient to users) or when suitable.

Expand Down Expand Up @@ -226,7 +226,7 @@ The reason `webClientId` is a required parameter is API uniformity across all pl

## Web support

Providing a unified API across all platforms is a bit more complex than it may seem. The web experience is different from the mobile one, and so are the underlying APIs.
Providing a unified API across all platforms is a bit more tricky than it may seem. The web experience is different from the mobile one, and so are the underlying APIs.

The `GoogleOneTapSignIn.signIn` and `GoogleOneTapSignIn.createAccount` functions are not `Promise`-based but callback-based as seen below. That means they return `void` and you need to provide callbacks for success and error handling.

Expand Down Expand Up @@ -260,7 +260,7 @@ useEffect(() => {
momentListener: (moment) => {
// optional
},
}
},
);
}
}, []);
Expand Down
1 change: 0 additions & 1 deletion docs/original.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,3 @@ try {
You may also use this call at any time to find out if Google Play Services are available and react to the result as necessary.

![prompt install](/img/prompt-install.png)

1 change: 0 additions & 1 deletion docs/setting-up/get-config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Please note that you **do not** need Firebase to configure Google Sign In. Howev

If you're using Expo EAS, read [credentials docs](https://docs.expo.dev/app-signing/managed-credentials/#inspecting-credentials-configuration) to learn how to obtain information about how your app is signed with EAS.


### Android SHA-1 certificate fingerprint note

You could have multiple signing configurations - for example for building debug APK, release APK, and [Play App Signing](https://support.google.com/googleplay/android-developer/answer/9842756?hl=en) for production deployments. You will need to get the SHA1 certificate fingerprints
Expand Down
9 changes: 4 additions & 5 deletions docs/setting-up/web.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ import Script from "next/script";

```tsx
useEffect(() => {
const scriptTag = document.createElement('script');
scriptTag.src = 'https://accounts.google.com/gsi/client';
const scriptTag = document.createElement("script");
scriptTag.src = "https://accounts.google.com/gsi/client";
scriptTag.async = true;
scriptTag.onload = () => {
setLoaded(true);
};
scriptTag.onerror = () => {
console.error('Failed to load Google One-tap script');
console.error("Failed to load Google One-tap script");
};

document.body.appendChild(scriptTag);
document.body.appendChild(scriptTag);
}, []);

```

</TabItem>
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"prettier:write": "prettier --write '**/*.{md,mdx}'",
"prettier:check": "prettier --list-different '**/*.{md,mdx}'"
},
"dependencies": {
"@docusaurus/core": "^3.4.0",
Expand All @@ -29,6 +31,7 @@
"@docusaurus/tsconfig": "^3.4.0",
"@docusaurus/types": "^3.4.0",
"docusaurus-plugin-typedoc": "^0.22.0",
"prettier": "^3.3.2",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "~5.2.2"
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6476,6 +6476,7 @@ __metadata:
clsx: "npm:^2.1.0"
docusaurus-lunr-search: "npm:^3.3.2"
docusaurus-plugin-typedoc: "npm:^0.22.0"
prettier: "npm:^3.3.2"
prism-react-renderer: "npm:^2.3.1"
react: "npm:^18.0.0"
react-dom: "npm:^18.0.0"
Expand Down Expand Up @@ -11347,6 +11348,15 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.3.2":
version: 3.3.2
resolution: "prettier@npm:3.3.2"
bin:
prettier: bin/prettier.cjs
checksum: 10c0/39ed27d17f0238da6dd6571d63026566bd790d3d0edac57c285fbab525982060c8f1e01955fe38134ab10f0951a6076da37f015db8173c02f14bc7f0803a384c
languageName: node
linkType: hard

"pretty-error@npm:^4.0.0":
version: 4.0.0
resolution: "pretty-error@npm:4.0.0"
Expand Down