Skip to content

Latest commit

 

History

History
104 lines (75 loc) · 2.64 KB

File metadata and controls

104 lines (75 loc) · 2.64 KB
title Widgets
description ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track.
og:title Widgets | ActivitySmith
og:description Track any value on your Lock Screen with ActivitySmith widgets.
og:image https://cdn.activitysmith.com/changelog/lock-screen-widgets.png

ActivitySmith Lock Screen widgets

How It Works

  1. Create a metric in the web app.
  2. Update the value using API anytime it changes.
  3. Add the widget to your iPhone Lock Screen.
  4. The widget fetches the latest value about every 15 minutes. iOS manages the refresh schedule.

When creating a metric, you can choose the format: number, currency, percent, unit, or string.

Create a widget metric in ActivitySmith

Updating Metric Value

Use the metric key when sending updates. Values can be numbers or strings.

import ActivitySmith from "activitysmith";

const activitysmith = new ActivitySmith({
  apiKey: process.env.ACTIVITYSMITH_API_KEY,
});

await activitysmith.metrics.update("deploy.success_rate", 99.9);
import os
from activitysmith import ActivitySmith

activitysmith = ActivitySmith(api_key=os.environ["ACTIVITYSMITH_API_KEY"])

activitysmith.metrics.update("deploy.success_rate", 99.9)
package main

import (
	"log"

	activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)

func main() {
	activitysmith, err := activitysmithsdk.New("YOUR-API-KEY")
	if err != nil {
		log.Fatal(err)
	}

	_, err = activitysmith.Metrics.Update("deploy.success_rate", 99.9)
	if err != nil {
		log.Fatal(err)
	}
}
<?php

use ActivitySmith\ActivitySmith;

$activitysmith = new ActivitySmith($_ENV['ACTIVITYSMITH_API_KEY']);

$activitysmith->metrics->update('deploy.success_rate', 99.9);
require "activitysmith"

activitysmith = ActivitySmith::Client.new(api_key: ENV.fetch("ACTIVITYSMITH_API_KEY"))

activitysmith.metrics.update("deploy.success_rate", 99.9)
curl -X POST "https://activitysmith.com/api/metrics/deploy.success_rate/value" \
  -H "Authorization: Bearer $ACTIVITYSMITH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "value": 99.9 }'

For the full API reference, see Update Metric Value.