svelte-obfuscate
This package provides a Svelte component to obfuscate any contact link from a website and prevent bots from scraping it.
Usage
Install the NPM package svelte-obfuscate
to your project and then add it to your layout:
<script>
import { Obfuscate } from "svelte-obfuscate"
</script>
<Obfuscate email="pedro@craftweg.com">
Props
Any of the following props can be passed to the Svelte component.
Prop | Type | Default | Description |
---|---|---|---|
email |
string |
null |
email address of the intended recipient |
headers |
object |
null |
subject, cc, bcc, body, etc |
telephone |
string |
null |
telephone number of the intended recipient |
sms |
string |
null |
sms number of the intended recipient |
facetime |
string |
null |
facetime address of the intended recipient |
href |
string |
null |
Obfuscate any other URL type (e.g. WhatsApp) |