Skip to content

Instantly share code, notes, and snippets.

@evdama
Last active August 6, 2019 13:16
Show Gist options
  • Select an option

  • Save evdama/f5d343267a7121e9a6493827e6d7bfd8 to your computer and use it in GitHub Desktop.

Select an option

Save evdama/f5d343267a7121e9a6493827e6d7bfd8 to your computer and use it in GitHub Desktop.
adding reCAPTCHA v3 to sapper app throws error
<!DOCTYPE html>
<html lang="en" class="min-h-full text-one antialiased font-family-one text-sm md:text-base bg-one" data-theme="light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="theme-color" content="#ffffff" />
<script src="https://www.google.com/recaptcha/api.js?render=6Lcnm7EUAAAAAOWFIrRWVkA8zvckeG8RIjELdaSj"></script>
%sapper.base%
<link rel="stylesheet" rel="preconnect" href="https://fonts.googleapis.com/css?family=Montserrat:200,400,700,900|Roboto:200,400,700,900&display=swap"/>
<link rel="manifest" rel="preconnect" href="manifest.json" />
<link rel="stylesheet" href="global.css" />
<link rel="icon" href="favicon-16x16.png" type="image/png" sizes="16x16" id="favicon">
<link rel="apple-touch-icon" rel="preconnect" sizes="180x180" href="apple-touch-icon.png">
<!-- Sapper generates a <style> tag containing critical CSS
for the current page. CSS for the rest of the app is
lazily loaded when it precaches secondary pages -->
%sapper.styles%
<!-- This contains the contents of the <svelte:head> component, if
the current page has one -->
%sapper.head%
</head>
<body>
<!-- The application will be rendered inside this element,
because `app/client.js` references it -->
<div class="container sm:mt-2 md:mt-4">
<div id="sapper" class="min-h-screen flex flex-col">%sapper.html%</div>
</div>
<!-- Sapper creates a <script> tag containing `app/client.js`
and anything else it needs to hydrate the app and
initialize the router -->
%sapper.scripts%
<script>
if (process.browser) {
grecaptcha.ready(() => {
grecaptcha
.execute('6Lcnm7EUAAAAAOWFIrRWVkA8zvckeG8RIjELdaSj', { action: 'homepage' })
.then(token => {
console.log(token)
})
})
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment