Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Async CustomerIO Client - a Python client to interact with CustomerIO in an async fashion.
customerio
haspip install async-customerio
import asyncio
from async_customerio import AsyncCustomerIO, Regions
async def main():
site_id = "Some-id-gotten-from-CustomerIO"
api_key = "Some-key-gotten-from-CustomerIO"
cio = AsyncCustomerIO(site_id, api_key, region=Regions.US)
await cio.identify(
id=5,
email="customer@example.com",
first_name="John",
last_name="Doh",
subscription_plan="premium",
)
await cio.track(
customer_id=5, name="product.purchased", product_sku="XYZ-12345", price=23.45
)
if __name__ == "__main__":
asyncio.run(main())
AsyncCustomerIO
objectCreate an instance of the client with your Customer.io credentials.
from async_customerio import AsyncCustomerIO, Regions
cio = AsyncCustomerIO(site_id, api_key, region=Regions.US)
region
is optional and takes one of two values — Regions.US
or Regions.EU
. If you do not specify your region, we assume
that your account is based in the US (Regions.US
). If your account is based in the EU and you do not provide the correct region
(Regions.EU
), we'll route requests to our EU data centers accordingly, however, this may cause data to be logged in the US.
from async_customerio import validate_signature
def main():
webhook_signing_key = (
"755781b5e03a973f3405a85474d5a032a60fd56fabaad66039b12eadd83955fa"
)
x_cio_timestamp = 1692633432 # header value
x_cio_signature = "d7c655389bb364d3e8bdbb6ec18a7f1b6cf91f39bba647554ada78aa61de37b9" # header value
body = b'{"key": "value"}'
if validate_signature(
signing_key=webhook_signing_key,
timestamp=x_cio_timestamp,
request_body=body,
signature=x_cio_signature,
):
print("Request is sent from CustomerIO")
else:
print("Malicious request received")
if __name__ == "__main__":
main()
async-customerio
is offered under the MIT license.
The latest developer version is available in a GitHub repository: https://github.com/healthjoy/async-customerio
FAQs
Async CustomerIO Client - a Python client to interact with CustomerIO in an async fashion.
We found that async-customerio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.