Skip to content

useGsiScript

This composable loads the Google Client Library. It make sure to load the library only once. So multiple calls wont add multiple script tags to the page.

<script setup lang="ts">
import { useGsiScript } from "vue3-google-signin";
// load GSI script
const { scriptLoaded, scriptLoadError } = useGsiScript();
</script>
export type UseGsiScriptReturn = {
/**
* Script loaded successfully
*
* @type {Readonly<Ref<boolean>>}
*/
scriptLoaded: Readonly<Ref<boolean>>;
/**
* Failed to load the GSI script
*
* @type {Readonly<Ref<boolean>>}
*/
scriptLoadError: Readonly<Ref<boolean>>;
};