async def METHOD_NAME(app, event_loop, client_id):
    """Create a stan connection for each function.
    Uses environment variables for the cluster name.
    """
    nc = Nats()
    sc = Stan()
    await nc.connect(io_loop=event_loop)
    cluster_name = os.getenv('STAN_CLUSTER_NAME')
    if not cluster_name:
        raise ValueError('Missing env variable: STAN_CLUSTER_NAME')
    await sc.connect(cluster_name, client_id, nats=nc)
    yield sc
    await sc.close()
    await nc.close()